Fix ETL race condition problem (#1132)

Wait for previous publish being finished to switch to writer.
This commit is contained in:
cyan317
2024-01-24 16:55:08 +00:00
committed by GitHub
parent 28c8fa2a9a
commit ab33b26ec4
4 changed files with 29 additions and 3 deletions

View File

@@ -47,6 +47,10 @@ ETLService::runETLPipeline(uint32_t startSequence, uint32_t numExtractors)
if (finishSequence_ && startSequence > *finishSequence_)
return {};
LOG(log_.debug()) << "Wait for cache containing seq " << startSequence - 1
<< " current cache last seq =" << backend_->cache().latestLedgerSequence();
backend_->cache().waitUntilCacheContainsSeq(startSequence - 1);
LOG(log_.debug()) << "Starting etl pipeline";
state_.isWriting = true;