Re: Fix logical decoding not track transaction during SNAPBUILD_BUILDING_SNAPSHOT

Поиск
Список
Период
Сортировка
От cca5507
Тема Re: Fix logical decoding not track transaction during SNAPBUILD_BUILDING_SNAPSHOT
Дата
Msg-id tencent_F5B08C1B5EF901955D722859E17B6D780A06@qq.com
обсуждение исходный текст
Ответ на RE: Fix logical decoding not track transaction during SNAPBUILD_BUILDING_SNAPSHOT  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
Список pgsql-hackers
Hi all,

I think the only ugly code in v6-0001 is:

```
     if (SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT)
+    {
+        /*
+         * If we are building snapshot and the xlog means a catalog
+         * change, we need to mark it in the reorder buffer.
+         *
+         * Now only XLOG_HEAP2_NEW_CID means a catalog change.
+         */
+        if (SnapBuildCurrentState(builder) >= SNAPBUILD_BUILDING_SNAPSHOT &&
+            TransactionIdIsValid(xid) && info == XLOG_HEAP2_NEW_CID)
+            ReorderBufferXidSetCatalogChanges(ctx->reorder, xid, buf->origptr);
+
         return;
+    }
```

If we can commit the patch in [1] first, it can just be replaced by:

```
-    if (SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT)
+    if (SnapBuildCurrentState(builder) < SNAPBUILD_BUILDING_SNAPSHOT)
         return;
```

Thoughts?

[1]: https://www.postgresql.org/message-id/flat/tencent_3A071B760AA1A38540B57F297332B7781C08%40qq.com

--
Regards,
ChangAo Chen

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