Re: logical replication worker accesses catalogs in error context callback
От | Bharath Rupireddy |
---|---|
Тема | Re: logical replication worker accesses catalogs in error context callback |
Дата | |
Msg-id | CALj2ACWGF4yQ4aZ-kr6UTRd0yQsM_J_OhxEN=9pS3idYnv4X+A@mail.gmail.com обсуждение исходный текст |
Ответ на | logical replication worker accesses catalogs in error context callback (Andres Freund <andres@anarazel.de>) |
Список | pgsql-hackers |
On Wed, Mar 17, 2021 at 4:52 PM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote: > > On Tue, Mar 16, 2021 at 2:21 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > > Thanks for pointing to the changes in the commit message. I corrected > > > them. Attaching v4 patch set, consider it for further review. > > > > I took a quick look at this. I'm quite worried about the potential > > performance cost of the v4-0001 patch (the one for fixing > > slot_store_error_callback). Previously, we didn't pay any noticeable > > cost for having the callback unless there actually was an error. > > As patched, we perform several catalog lookups per column per row, > > even in the non-error code path. That seems like it'd be a noticeable > > performance hit. Just to add insult to injury, it leaks memory. > > > > I propose a more radical but simpler solution: let's just not bother > > with including the type names in the context message. How much are > > they really buying? > > Thanks. In that case, the message can only return the local and remote > columns names and ignore the types (something like below). And the > user will have to figure out what are the types of those columns in > local and remote separately in case of error. Then the function > logicalrep_typmap_gettypname can also be removed. I'm not sure if this > is okay. Thoughts? Hi Tom, As suggested earlier, I'm attaching a v5 patch that avoids printing the column type names in the context message thus no cache lookups have to be done in the error context callback. I think the column name is enough to know on which column the error occurred and if required it's type can be known by the user. This patch gets rid of printing local and remote type names in slot_store_error_callback and also logicalrep_typmap_gettypname because it's unnecessary. I'm not sure if this solution is acceptable. Thoughts? With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com
Вложения
В списке pgsql-hackers по дате отправления: