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

Reply via email to