Fairly serious bug induced by latest guc enum changes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Fairly serious bug induced by latest guc enum changes
Дата
Msg-id 26433.1210623732@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Fairly serious bug induced by latest guc enum changes  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
I see that assign_xlog_sync_method() is still assigning to sync_method.
This is 100% wrong: an assign hook is chartered to set derived values,
but not to set the GUC variable itself.  This will for example result
in set_config_option() stacking the wrong value (the already-updated
one) as the value to roll back to if the transaction aborts.

You could just remove the assignment from assign_xlog_sync_method,
although it might look a bit odd to be setting open_sync_bit but
not sync_method.  It also bothers me slightly that the derived and
main values wouldn't be set at exactly the same point --- problems
inside guc.c might lead to them getting out of sync.

Another possibility is to stick with something equivalent to the former
design: what GUC thinks is the variable is just a dummy static integer
in guc.c, and the assign hook is still setting the "real" value that the
rest of the code looks at.  A minor advantage of this second way is that
the "real" value could still be declared as enum rather than int.

Please fix this, and take another look at the prior WAL enum changes
to see if the same problem hasn't been created elsewhere.
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: bloated heapam.h
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Fairly serious bug induced by latest guc enum changes