Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/backend/distributed/executor/citus_custom_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,10 @@ IsCitusCustomScan(Plan *plan)
}

Node *privateNode = (Node *) linitial(customScan->custom_private);
//shoud check privateNode is null ptr
if (privateNode == NULL){
return false;
Copy link
Copy Markdown
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.

}
if (!CitusIsA(privateNode, DistributedPlan))
{
return false;
Expand Down
9 changes: 8 additions & 1 deletion src/backend/distributed/executor/local_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,14 @@ TaskAccessesLocalNode(Task *task)
{
if (taskPlacement->groupId == localGroupId)
{
return true;
//check if it's running on standby node
if( (task->taskType == MODIFY_TASK||
task->taskType ==DDL_TASK) && RecoveryInProgress())
{
return false;
}else{
return true;
}
}
}

Expand Down