[HACKERS] cache lookup errors for missing replication origins

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема [HACKERS] cache lookup errors for missing replication origins
Дата
Msg-id CAB7nPqQtPg+LKKtzdKN26judHcvPZ0s1gNigzOT4j8CYuuuBYg@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] cache lookup errors for missing replication origins  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hi all,

Cache lookup errors with elog() can be triggered easily by users at
SQL level using replication origin functions:
=# select pg_replication_origin_advance('popo', '0/1');
ERROR:  XX000: cache lookup failed for replication origin 'popo'
LOCATION:  replorigin_by_name, origin.c:229
=# select pg_replication_origin_drop('popo');
ERROR:  XX000: cache lookup failed for replication origin 'popo'
LOCATION:  replorigin_by_name, origin.c:229
=# select pg_replication_origin_session_setup('popo');
ERROR:  XX000: cache lookup failed for replication origin 'popo'
LOCATION:  replorigin_by_name, origin.c:229
=# select pg_replication_origin_progress('popo', true);
ERROR:  XX000: cache lookup failed for replication origin 'popo';
LOCATION:  replorigin_by_name, origin.c:229
A cache lookup means that an illogical status has been reached, but
those code paths don't refer to that. So I think that the error in
replorigin_by_name should be changed to that:
ERROR:  42704: replication slot "%s" does not exist

As far as I can see, replorigin_by_oid makes no use of its missing_ok
= false in the backend code, so letting it untouched would have no
impact. replorigin_by_name with missing_ok = false is only used with
SQL-callable functions, so it could be changed without any impact
elsewhere (without considering externally-maintained replication
modules).

Thanks,
-- 
Michael



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Useless code in ExecInitModifyTable
Следующее
От: Ryan Murphy
Дата:
Сообщение: Re: [HACKERS] Useless code in ExecInitModifyTable