Re: [Proposal] Adding callback support for custom statistics kinds
| От | Sami Imseih |
|---|---|
| Тема | Re: [Proposal] Adding callback support for custom statistics kinds |
| Дата | |
| Msg-id | CAA5RZ0thcqk_r_SCB3TdXP9hVV5mG_29yc9GaGr4ujPQmcLDEQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: [Proposal] Adding callback support for custom statistics kinds (Sami Imseih <samimseih@gmail.com>) |
| Ответы |
Re: [Proposal] Adding callback support for custom statistics kinds
|
| Список | pgsql-hackers |
> After re-reading your earlier suggestions, this sounds like a third > callback that is used for file cleanup, and this callback could be > the existing reset_all_cb. Also, instead of reset_all_cb being called > during pgstat_reset_after_failure, it can be called during the success > case, i.e, a new pgstat_reset_after_success. reset_all_cb also > carries a status argument so the extension knows what to do > in the case of success or failure. > This also means we need to also update all existing callbacks to > do work in the failed status. After second thought, I am not too thrilled with extending reset_all_cb to take responsibility for file cleanup, etc. I think it should just remain used to reset stats only. I think the best way forward will be to introduce a callback to be used by custom kinds only. This callback will be responsible for cleaning up files and related resources at the end of the write stats, read stats, and discard stats paths. The callback will provide back to the extension a status (READ, WRITE, DISCARD) and the extension will know how to clean up the resources it created depending on the situation. So, unlike my original proposal, this puts more responsibility on the extension to track and clean up its files, but this seems like the best approach to take here. Also, I am now leaning towards creating a separate test module rather than trying to do too much unrelated testing in injection points. It is definitely convenient to use injection points, but I think we can do better testing with a separate module. This module can also serve as an example for extension developers. what do you think? -- Sami Imseih Amazon Web Services (AWS)
В списке pgsql-hackers по дате отправления: