Skip to content

Conversation

@templarzq
Copy link

@templarzq templarzq commented Dec 23, 2025

Issue: #8426
Citus version: master
DESCRIPTION:
set citus.writable_standby_coordinator ="on", when insert values on secondary work node, if the values belong to local shard tables, the plan will run on local node ,this will trigger an error.
this pull request will fix this error, route the plan to correct primary node to execute the insert sql.

@templarzq templarzq changed the title Fix error when execute insert on secondary worker node Fix error when executing insert on secondary worker node Dec 24, 2025
templarzq

This comment was marked as resolved.

@templarzq
Copy link
Author

@templarzq please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Added check for if its running in recovery progress before returning task placement status.
add private Node pointer  null check
@colm-mchugh
Copy link
Contributor

Thanks for this PR, can you add a regress test with the problem ?

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.52%. Comparing base (851c9cd) to head (ba6a442).
⚠️ Report is 8 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (851c9cd) and HEAD (ba6a442). Click for more details.

HEAD has 134 uploads less than BASE
Flag BASE (851c9cd) HEAD (ba6a442)
18_regress_check-query-generator 2 0
17_citus_upgrade 2 0
16_citus_upgrade 2 0
17_regress_check-pytest 2 0
16_regress_check-pytest 2 0
18_regress_check-pytest 2 0
17_regress_check-follower-cluster 2 0
17_regress_check-columnar-isolation 2 0
18_regress_check-columnar-isolation 2 0
16_regress_check-follower-cluster 1 0
18_regress_check-follower-cluster 2 0
17_18_upgrade 2 0
16_18_upgrade 2 0
17_regress_check-add-backup-node 2 0
18_regress_check-add-backup-node 2 0
16_17_upgrade 2 0
18_regress_check-columnar 2 0
18_regress_check-enterprise-isolation-logicalrep-3 2 0
16_regress_check-enterprise-isolation-logicalrep-3 1 0
17_regress_check-enterprise-isolation-logicalrep-2 1 0
16_regress_check-split 2 0
18_regress_check-split 2 0
17_regress_check-enterprise-failure 1 0
17_regress_check-columnar 2 0
18_regress_check-enterprise-failure 1 0
16_regress_check-query-generator 1 0
18_regress_check-vanilla 2 0
16_regress_check-enterprise-failure 2 0
16_regress_check-enterprise-isolation-logicalrep-2 2 0
17_regress_check-query-generator 1 0
17_regress_check-enterprise-isolation-logicalrep-3 2 0
17_regress_check-split 1 0
16_regress_check-columnar 2 0
16_regress_check-add-backup-node 2 0
16_regress_check-enterprise 2 0
17_regress_check-vanilla 2 0
16_regress_check-vanilla 2 0
17_regress_check-enterprise 2 0
18_regress_check-enterprise 2 0
17_regress_check-enterprise-isolation 2 0
18_regress_check-enterprise-isolation-logicalrep-2 2 0
16_regress_check-enterprise-isolation-logicalrep-1 2 0
18_regress_check-enterprise-isolation 2 0
18_regress_check-enterprise-isolation-logicalrep-1 2 0
17_regress_check-enterprise-isolation-logicalrep-1 2 0
18_regress_check-multi-mx 2 0
16_regress_check-enterprise-isolation 2 0
16_regress_check-failure 2 0
18_cdc_installcheck 2 0
18_regress_check-failure 2 0
16_regress_check-multi-mx 2 0
17_regress_check-multi-mx 2 0
16_regress_check-columnar-isolation 2 0
17_regress_check-isolation 2 0
17_regress_check-failure 2 0
18_regress_check-operations 2 0
17_cdc_installcheck 2 0
16_cdc_installcheck 2 0
16_regress_check-operations 2 0
17_regress_check-operations 2 0
16_regress_check-isolation 2 0
18_regress_check-isolation 2 0
17_arbitrary_configs_0 1 0
18_regress_check-multi 2 1
17_regress_check-multi 2 0
16_arbitrary_configs_5 1 0
17_arbitrary_configs_5 2 1
16_regress_check-multi-1 1 0
17_arbitrary_configs_2 1 0
16_arbitrary_configs_2 1 0
17_regress_check-multi-1 1 0
17_arbitrary_configs_4 1 0
18_arbitrary_configs_4 1 0
16_arbitrary_configs_4 1 0
18_arbitrary_configs_0 1 0
16_arbitrary_configs_0 1 0
18_arbitrary_configs_1 1 0
17_arbitrary_configs_1 1 0
16_arbitrary_configs_1 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8419      +/-   ##
==========================================
- Coverage   88.80%   83.52%   -5.28%     
==========================================
  Files         287      287              
  Lines       63236    62988     -248     
  Branches     7927     7878      -49     
==========================================
- Hits        56155    52613    -3542     
- Misses       4750     7725    +2975     
- Partials     2331     2650     +319     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Node *privateNode = (Node *) linitial(customScan->custom_private);
//shoud check privateNode is null ptr
if (privateNode == NULL){
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be preferable to throw an error here, given that custom_private is unconditionally set in FinalizePlan(). If the list contains a NULL it indicates something has gone wrong before this point. Suggest debugging FinalizePlan() from the point where custom_private is set, and try to determine if the CustomScan node is initialized correctly there and where it changes state to result in the problem here.

@templarzq
Copy link
Author

templarzq commented Jan 12, 2026

it seems that we need some new test case to pass the code coverage test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants