Skip to content

Commit 717bdb7

Browse files
authored
avoid busy loop (#12157)
1 parent 701a5e7 commit 717bdb7

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

fdbclient/ServerKnobs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
391391
init( MANIFEST_COUNT_MAX_PER_BULKLOAD_TASK, 10 ); if (isSimulated) MANIFEST_COUNT_MAX_PER_BULKLOAD_TASK = deterministicRandom()->randomInt(1, 11);
392392
init( BULKLOAD_SIM_FAILURE_INJECTION, false ); if (isSimulated) BULKLOAD_SIM_FAILURE_INJECTION = true;
393393
init( DD_BULKLOAD_POWER_OF_D_RATIO, 2.0 ); if (isSimulated) DD_BULKLOAD_POWER_OF_D_RATIO = deterministicRandom()->randomInt(1, 11);
394+
init( DD_BULKLOAD_TASK_SUBMISSION_INTERVAL_SEC, 0.01 );
394395

395396
// BulkDumping
396397
init( DD_BULKDUMP_SCHEDULE_MIN_INTERVAL_SEC, 5.0 ); if( randomize && BUGGIFY ) DD_BULKDUMP_SCHEDULE_MIN_INTERVAL_SEC = deterministicRandom()->random01() * 10 + 1;

fdbclient/include/fdbclient/ServerKnobs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ class SWIFT_CXX_IMMORTAL_SINGLETON_TYPE ServerKnobs : public KnobsImpl<ServerKno
418418
double DD_BULKLOAD_POWER_OF_D_RATIO; // When selecting the dest team, DD randomly chooses 1/D portion of all valid
419419
// teams as the candidates and the DD selects the team with the minimal number
420420
// of ongoing tasks from the candidates as the dest team.
421+
double DD_BULKLOAD_TASK_SUBMISSION_INTERVAL_SEC; // the seconds that the bulkload task submitter has to wait
422+
// between two tasks
421423
bool CC_ENFORCE_USE_UNFIT_DD_IN_SIM; // Set for CC to enforce to use an unfit DD in the simulation. This knob takes
422424
// effect only in the simulation.
423425
bool DISABLE_AUDIT_STORAGE_FINAL_REPLICA_CHECK_IN_SIM; // Set to disable audit storage replica check in the

fdbserver/DataDistribution.actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ ACTOR Future<Void> scheduleBulkLoadJob(Reference<DataDistributor> self, Promise<
19411941
self->bulkLoadJobManager.get().manifestLocalTempFolder,
19421942
manifestEntries,
19431943
errorOut));
1944-
wait(yield()); // Avoid busy loop
1944+
wait(delay(SERVER_KNOBS->DD_BULKLOAD_TASK_SUBMISSION_INTERVAL_SEC)); // Avoid busy loop
19451945
}
19461946
ASSERT(beginKey == res[i + 1].key);
19471947
}

0 commit comments

Comments
 (0)