Re: [Proposal] Adding callback support for custom statistics kinds

Поиск
Список
Период
Сортировка
От Sami Imseih
Тема Re: [Proposal] Adding callback support for custom statistics kinds
Дата
Msg-id CAA5RZ0sg6gskHRgfymo9njEWuXDyn0Zwe+0bcX=nByyE7W+6bw@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 (kind_info->from_serialized_extra_stats)
> +                                       {
> +                                               if (!kind_info->from_serialized_extra_stats(&key, header, fpin))
> +                                               {
> +                                                       elog(WARNING, "could not read extra stats for entry %u/%u/%"
PRIu64,
> +                                                                key.kind, key.dboid, key.objid);
> +                                                       goto error;
> +                                               }
> +                                       }
> ```
>
> When deserialize failed, it goes to error. In the error clause, it calls pgstat_reset_after_failure(), so do we want
togive extensions a chance to do some reset operations? If yes, then we can add a reset_after_failure() callback.
 

The way v5 is dealing with a deserialize failure is that when
it goes to error, the pgstat_reset_after_failure() will reset the
stats for all kinds, since pgstat_drop_all_entries() is called
during that call. So there is nothing for an extension to have
to do on its own. The extension will then clean-up resources
at the end when  all the kinds are iterated over and
kind_info->end_extra_stats(STATS_READ) is called for each
kind.

Let me know if I'm still missing something?

--
Sami Imseih
Amazon Web Services (AWS)



В списке pgsql-hackers по дате отправления: