Skip to content

Commit

Permalink
175021851:
Browse files Browse the repository at this point in the history
-queue shards for running coordinator at the beginning of the queue
-end coordinator tries to finish, make sure it tells all shards to terminate

Signed-off-by: Dorin Hogea <[email protected]>
  • Loading branch information
dorinhogea committed Apr 30, 2024
1 parent 6649536 commit 383ecb3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions db/dohsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,12 @@ int dohsql_distribute(dohsql_node_t *node)
* worker shards on the queue in any case
*/
flags |= THDPOOL_FORCE_QUEUE;
/**
* Lets put the non-coordinator tasks at the beginning of the
* queue since we have already dispatched the coordinator
* This will clear the parallel load faster and in proper order
*/
flags |= THDPOOL_ENQUEUE_FRONT;
clnt->conns = conns;
/* augment interface */
_master_clnt_set(clnt);
Expand Down Expand Up @@ -1258,6 +1264,9 @@ int dohsql_end_distribute(struct sqlclntstate *clnt, struct reqlogger *logger)
if (!clnt->conns)
return SHARD_NOERR;

/* if we got here anyhow, make sure we tell all the shards to finish */
_signal_children_master_is_done(conns);

donate_current_row(conns, 0);

for (i = 1; i < conns->nconns; i++) {
Expand Down

0 comments on commit 383ecb3

Please sign in to comment.