Actually no. EnableHotStandby only will be true on hot_standby cluster. On the primary cluster, it's always false. But the distrib_xid is written to xlog by primary cluster.
Discussed with Max. We prefer to use a Var , may be named 'enable_distri_xid' , it is like the var ' NEXTGXID', it will be both store in a configure file and xlog. Then it will be synced to standby cluster. The standby cluster will check the variable 'enable_distri_xid', if it's true, then the cluster cannot be configured as hot_standby. How do you think about this idea? yjhjstz (via GitHub) <g...@apache.org> 于2025年6月18日周三 23:22写道: > > yjhjstz commented on code in PR #1152: > URL: https://github.com/apache/cloudberry/pull/1152#discussion_r2154899650 > > > ########## > src/backend/access/transam/xact.c: > ########## > @@ -6880,8 +6884,8 @@ XactLogCommitRecord(TimestampTz commit_time, > xl_xact_distrib xl_distrib; > xl_xact_deldbs xl_deldbs; > XLogRecPtr recptr; > - bool isOnePhaseQE = (Gp_role == GP_ROLE_EXECUTE && > MyTmGxactLocal->isOnePhaseCommit); > bool isDtxPrepared = isPreparedDtxTransaction(); > + DistributedTransactionId distrib_xid = > getDistributedTransactionId(); > > Review Comment: > can we use `EnableHotStandby` to control distrib_xid usage ? > > > > -- > This is an automated message from the Apache Git Service. > To respond to the message, please log on to GitHub and use the > URL above to go to the specific comment. > > To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org > > For queries about this service, please contact Infrastructure at: > us...@infra.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org > For additional commands, e-mail: commits-h...@cloudberry.apache.org > > -- Best regards ! Xiaoran Wang