Re: [Proposal] Adding callback support for custom statistics kinds
| От | Sami Imseih |
|---|---|
| Тема | Re: [Proposal] Adding callback support for custom statistics kinds |
| Дата | |
| Msg-id | CAA5RZ0sJgO6GAwgFxmzg9MVP=rM7Us8KKcWpuqxe-f5qxmpE0g@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: [Proposal] Adding callback support for custom statistics kinds (Chao Li <li.evan.chao@gmail.com>) |
| Ответы |
Re: [Proposal] Adding callback support for custom statistics kinds
|
| Список | pgsql-hackers |
> If we push down the responsibility into the extension code, then all extensions > that want to enjoy the callbacks have to handle the same complexities of dealing > with stat files, which sounds big duplicate efforts. Thanks for the input! Yes, this is a trade-off between putting responsibility on the extension vs core. The initial thought I had was exactly like yours, but it will be easier to get something pushed if we make the core changes as minimal as possible. If there are enough complaints in the future, this can be revisited. Particularly if there is a common patterns for file cleanup, this could be turned into a core utility. > That looks like a good direction to me. The only differences I can > see with the stats module in injection_points for variable-sized stats > is that this new module does not check pgstat_drop_entry() and > pgstat_fetch_entry() when working on a custom stats kind. If we had > SQL interfaces calling these two, we could just remove > injection_stats.c entirely, moving everything to this new test module. > I should have invented a new module from the start, perhaps, but well, > that was good enough to check the basic APIs when working on the > custom APIs. Removing this duplication would be my own business with > your module in the tree, no need for you to worry about that. That > would also remove the tweak you have used regarding the duplicated > kind ID. I plan on addressing the other comments. However, as discussed off-list, I do think moving the custom kind tests from injection points to the new test module is a prerequisite. I rather not have us push a new test module that is doing duplicate work as the injection stats tests. I worked on this refactoring today and plan to have a patch ready for review by tomorrow. -- Sami Imseih Amazon Web Services (AWS)
В списке pgsql-hackers по дате отправления: