You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "Mulily0513 (via GitHub)" <gi...@apache.org> on 2025/08/12 03:21:34 UTC

[PR] Add guc gp_segment_configuration_file for hot standby [cloudberry]

Mulily0513 opened a new pull request, #1308:
URL: https://github.com/apache/cloudberry/pull/1308

   <!-- Thank you for your contribution to Apache Cloudberry (Incubating)! -->
   
   Fixes #ISSUE_Number
   
   ### What does this PR do?
   <!-- Brief overview of the changes, including any major features or fixes -->
   Add guc gp_segment_configuration_file
   
   For hot_standby which is built on basebackup
   data, the gp_segment_configuration table is
   copied from primary cluster and cannot be
   used by standby cluster.
   
   To fix that, add the guc gp_segment_configuration_file
   to load the standby cluster's segment info.
   It will be used by gpstart and getCdbComponentInfo
   when doing read only queries.
   
   
   ### Type of Change
   - [ ] Bug fix (non-breaking change)
   - [ ] New feature (non-breaking change)
   - [ ] Breaking change (fix or feature with breaking changes)
   - [ ] Documentation update
   
   ### Breaking Changes
   <!-- Remove if not applicable. If yes, explain impact and migration path -->
   
   ### Test Plan
   <!-- How did you test these changes? -->
   - [ ] Unit tests added/updated
   - [ ] Integration tests added/updated
   - [ ] Passed `make installcheck`
   - [ ] Passed `make -C src/test installcheck-cbdb-parallel`
   
   ### Impact
   <!-- Remove sections that don't apply -->
   **Performance:**
   <!-- Any performance implications? -->
   
   **User-facing changes:**
   <!-- Any changes visible to users? -->
   
   **Dependencies:**
   <!-- New dependencies or version changes? -->
   
   ### Checklist
   - [ ] Followed [contribution guide](https://cloudberry.apache.org/contribute/code)
   - [ ] Added/updated documentation
   - [ ] Reviewed code for security implications
   - [ ] Requested review from [cloudberry committers](https://github.com/orgs/apache/teams/cloudberry-committers)
   
   ### Additional Context
   <!-- Any other information that would help reviewers? Remove if none -->
   
   ### CI Skip Instructions
   <!--
   To skip CI builds, add the appropriate CI skip identifier to your PR title.
   The identifier must:
   - Be in square brackets []
   - Include the word "ci" and either "skip" or "no"
   - Only use for documentation-only changes or when absolutely necessary
   -->
   
   ---
   <!-- Join our community:
   - Mailing list: [dev@cloudberry.apache.org](https://lists.apache.org/list.html?dev@cloudberry.apache.org) (subscribe: dev-subscribe@cloudberry.apache.org)
   - Discussions: https://github.com/apache/cloudberry/discussions -->
   


-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc hot_dr for hot standby [cloudberry]

Posted by "Mulily0513 (via GitHub)" <gi...@apache.org>.
Mulily0513 commented on code in PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#discussion_r2281537589


##########
src/backend/cdb/cdbutil.c:
##########
@@ -131,6 +132,15 @@ typedef struct HostPrimaryCountEntry
  */
 static GpSegConfigEntry *
 readGpSegConfigFromFTSFiles(int *total_dbs)
+{
+	Assert(!IsTransactionState());
+	/* notify and wait FTS to finish a probe and update the dump file */

Review Comment:
   ok



-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc gp_segment_configuration_file for hot standby [cloudberry]

Posted by "Mulily0513 (via GitHub)" <gi...@apache.org>.
Mulily0513 commented on code in PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#discussion_r2281220228


##########
gpMgmt/bin/gpstart:
##########
@@ -55,7 +55,8 @@ class GpStart:
                  skip_heap_checksum_validation=False,
                  fts_hosts=None,
                  etcd_hosts=None,
-                 is_external_fts=False
+                 is_external_fts=False,
+                 segment_config_file=None

Review Comment:
   ok



##########
src/backend/access/transam/xlog.c:
##########
@@ -6629,7 +6629,16 @@ UpdateCatalogForStandbyPromotion(void)
 	/* I am privileged */
 	InitializeSessionUserIdStandalone();
 	gp_activate_standby();
-	write_gp_segment_configuration();
+
+	if (gp_segment_configuration_file && access(gp_segment_configuration_file, F_OK) == 0)
+	{
+		write_gp_segment_configuration();

Review Comment:
   ok



-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc hot_dr for hot standby [cloudberry]

Posted by "weinan003 (via GitHub)" <gi...@apache.org>.
weinan003 merged PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308


-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc gp_segment_configuration_file for hot standby [cloudberry]

Posted by "weinan003 (via GitHub)" <gi...@apache.org>.
weinan003 commented on code in PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#discussion_r2268734144


##########
gpMgmt/bin/gpstart:
##########
@@ -55,7 +55,8 @@ class GpStart:
                  skip_heap_checksum_validation=False,
                  fts_hosts=None,
                  etcd_hosts=None,
-                 is_external_fts=False
+                 is_external_fts=False,
+                 segment_config_file=None

Review Comment:
   不建议直接把segment config file配置的选项暴露给用户,以免错配后我们需要大量的鲁棒性检查



##########
src/backend/access/transam/xlog.c:
##########
@@ -6629,7 +6629,16 @@ UpdateCatalogForStandbyPromotion(void)
 	/* I am privileged */
 	InitializeSessionUserIdStandalone();
 	gp_activate_standby();
-	write_gp_segment_configuration();
+
+	if (gp_segment_configuration_file && access(gp_segment_configuration_file, F_OK) == 0)
+	{
+		write_gp_segment_configuration();

Review Comment:
   如果把重写gp_segment_configuration的逻辑放在内核中,就需要在内核regress测试中有回归测试进行保护。建议使用标准SQL在CBDR项目中完成这部分逻辑,并在CBDR中进行回归测试



##########
src/backend/utils/misc/guc_gp.c:
##########
@@ -5043,7 +5043,7 @@ struct config_string ConfigureNamesString_gp[] =
 		check_gp_interconnect_type, assign_gp_interconnect_type, show_gp_interconnect_type
 	},
 	{
-		{"gp_pause_on_restore_point_replay", PGC_SUSET, DEVELOPER_OPTIONS,

Review Comment:
   先spike一下pg的GUC option



-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc gp_segment_configuration_file for hot standby [cloudberry]

Posted by "Mulily0513 (via GitHub)" <gi...@apache.org>.
Mulily0513 commented on code in PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#discussion_r2281220534


##########
src/backend/utils/misc/guc_gp.c:
##########
@@ -5043,7 +5043,7 @@ struct config_string ConfigureNamesString_gp[] =
 		check_gp_interconnect_type, assign_gp_interconnect_type, show_gp_interconnect_type
 	},
 	{
-		{"gp_pause_on_restore_point_replay", PGC_SUSET, DEVELOPER_OPTIONS,

Review Comment:
   ok 



-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc hot_dr for hot standby [cloudberry]

Posted by "weinan003 (via GitHub)" <gi...@apache.org>.
weinan003 commented on code in PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#discussion_r2281484354


##########
src/backend/cdb/cdbutil.c:
##########
@@ -131,6 +132,15 @@ typedef struct HostPrimaryCountEntry
  */
 static GpSegConfigEntry *
 readGpSegConfigFromFTSFiles(int *total_dbs)
+{
+	Assert(!IsTransactionState());
+	/* notify and wait FTS to finish a probe and update the dump file */

Review Comment:
   one more `Assert(not in hot dr cluster)`?



-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc gp_segment_configuration_file for hot standby [cloudberry]

Posted by "Mulily0513 (via GitHub)" <gi...@apache.org>.
Mulily0513 commented on PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#issuecomment-3194983133

   > 帮忙调查一下isolation2中`installcheck-hot-standby`测试集是否已经在内核CI中运行了,如果没有的话,我们需要考虑将这部分测试集在内核或CBDR项目的CI中启动
   
   测试集没有在内核ci中运行,这部分需要在github ci中添加


-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Add guc gp_segment_configuration_file for hot standby [cloudberry]

Posted by "weinan003 (via GitHub)" <gi...@apache.org>.
weinan003 commented on PR #1308:
URL: https://github.com/apache/cloudberry/pull/1308#issuecomment-3177911690

   帮忙调查一下isolation2中`installcheck-hot-standby`测试集是否已经在内核CI中运行了,如果没有的话,我们需要考虑将这部分测试集在内核或CBDR项目的CI中启动


-- 
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-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org