diff --git a/fdbserver/DataDistribution.actor.cpp b/fdbserver/DataDistribution.actor.cpp index a3eaa254fa..19d85fbc2b 100644 --- a/fdbserver/DataDistribution.actor.cpp +++ b/fdbserver/DataDistribution.actor.cpp @@ -82,17 +82,30 @@ ShardSizeBounds ShardSizeBounds::shardSizeBoundsBeforeTrack() { .opsReadPerKSecond = StorageMetrics::infinity } }; } +namespace { + +std::set const& normalDDQueueErrors() { + static std::set s{ error_code_movekeys_conflict, + error_code_broken_promise, + error_code_data_move_cancelled, + error_code_data_move_dest_team_not_found }; + return s; +} + +} // anonymous namespace + enum class DDAuditContext : uint8_t { - Invalid = 0, - Resume = 1, - Launch = 2, - Retry = 3, + INVALID = 0, + RESUME = 1, + LAUNCH = 2, + RETRY = 3, }; + struct DDAudit { DDAudit(AuditStorageState coreState) : coreState(coreState), actors(true), foundError(false), auditStorageAnyChildFailed(false), retryCount(0), - cancelled(false), overallCompleteDoAuditCount(0), overallIssuedDoAuditCount(0), overallSkippedDoAuditCount(0), - remainingBudgetForAuditTasks(SERVER_KNOBS->CONCURRENT_AUDIT_TASK_COUNT_MAX), context(0) {} + cancelled(false), overallCompleteDoAuditCount(0), overallIssuedDoAuditCount(0), + remainingBudgetForAuditTasks(SERVER_KNOBS->CONCURRENT_AUDIT_TASK_COUNT_MAX), context(DDAuditContext::INVALID) {} AuditStorageState coreState; ActorCollection actors; @@ -105,14 +118,14 @@ struct DDAudit { int64_t overallCompleteDoAuditCount; int64_t overallSkippedDoAuditCount; AsyncVar remainingBudgetForAuditTasks; - uint8_t context; + DDAuditContext context; std::unordered_map serverProgressFinishMap; // dedicated to ssshard inline void setAuditRunActor(Future actor) { auditActor = actor; } inline Future getAuditRunActor() { return auditActor; } - inline void setDDAuditContext(DDAuditContext context) { this->context = static_cast(context); } - inline DDAuditContext getDDAuditContext() const { return static_cast(this->context); } + inline void setDDAuditContext(DDAuditContext context_) { this->context = context_; } + inline DDAuditContext getDDAuditContext() const { return context; } // auditActor and actors are guaranteed to deliver a cancel signal void cancel() { @@ -308,17 +321,6 @@ ACTOR Future debugCheckCoalescing(Database cx) { } } -static std::set const& normalDDQueueErrors() { - static std::set s; - if (s.empty()) { - s.insert(error_code_movekeys_conflict); - s.insert(error_code_broken_promise); - s.insert(error_code_data_move_cancelled); - s.insert(error_code_data_move_dest_team_not_found); - } - return s; -} - struct DataDistributor; void runAuditStorage(Reference self, AuditStorageState auditStates, @@ -455,7 +457,7 @@ public: // instance in DD audits map continue; } - runAuditStorage(self, auditState, 0, DDAuditContext::Resume); + runAuditStorage(self, auditState, 0, DDAuditContext::RESUME); TraceEvent(SevInfo, "AuditStorageResumed", self->ddId) .detail("AuditID", auditState.id) .detail("AuditType", auditState.getType()) @@ -522,14 +524,20 @@ public: // AuditStorage does not rely on DatabaseConfiguration // AuditStorage read neccessary info purely from system key space if (!self->auditStorageInitStarted) { - // Avoid multiple initAuditStorages - self->addActor.send(self->initAuditStorage(self)); + // AuditStorage currently does not support DDMockTxnProcessor + if (!self->txnProcessor->isMocked()) { + // Avoid multiple initAuditStorages + self->addActor.send(self->initAuditStorage(self)); + } } // It is possible that an audit request arrives and then DDMode // is set to 2 at this point // No polling MoveKeyLock is running // So, we need to check MoveKeyLock when waitUntilDataDistributorExitSecurityMode - wait(waitUntilDataDistributorExitSecurityMode(self)); // Trap DDMode == 2 + if (!self->txnProcessor->isMocked()) { + // AuditStorage currently does not suport DDMockTxnProcessor + wait(waitUntilDataDistributorExitSecurityMode(self)); // Trap DDMode == 2 + } // It is possible DDMode begins with 2 and passes // waitDataDistributorEnabled and then set to 0 before // waitUntilDataDistributorExitSecurityMode. For this case, @@ -1991,7 +1999,7 @@ ACTOR Future auditStorageCore(Reference self, // Erase the old audit from map and spawn a new audit inherit from the old audit removeAuditFromAuditMap(self, audit->coreState.getType(), audit->coreState.id); // remove audit - runAuditStorage(self, audit->coreState, audit->retryCount, DDAuditContext::Retry); + runAuditStorage(self, audit->coreState, audit->retryCount, DDAuditContext::RETRY); } else { try { audit->coreState.setPhase(AuditPhase::Failed); @@ -2164,7 +2172,7 @@ ACTOR Future launchAudit(Reference self, // At this point, the new audit is already in the audit map return auditID; } - runAuditStorage(self, auditState, 0, DDAuditContext::Launch); + runAuditStorage(self, auditState, 0, DDAuditContext::LAUNCH); } } catch (Error& e) { if (e.code() == error_code_actor_cancelled) { diff --git a/fdbserver/SimulatedCluster.actor.cpp b/fdbserver/SimulatedCluster.actor.cpp index 0b03120336..75268d2bf3 100644 --- a/fdbserver/SimulatedCluster.actor.cpp +++ b/fdbserver/SimulatedCluster.actor.cpp @@ -1828,6 +1828,13 @@ SimulationStorageEngine chooseSimulationStorageEngine(const TestConfig& testConf if (testConfig.storageEngineType.present()) { reason = "ConfigureSpecified"_sr; result = testConfig.storageEngineType.get(); + if (testConfig.excludedStorageEngineType(result) || + std::find(std::begin(SIMULATION_STORAGE_ENGINE), std::end(SIMULATION_STORAGE_ENGINE), result) == + std::end(SIMULATION_STORAGE_ENGINE)) { + + TraceEvent(SevError, "StorageEngineNotSupported").detail("StorageEngineType", result); + ASSERT(false); + } } else { constexpr auto NUM_RETRIES = 1000; for (auto _ = 0; _ < NUM_RETRIES; ++_) { diff --git a/fdbserver/workloads/PerpetualWiggleStorageMigrationWorkload.actor.cpp b/fdbserver/workloads/PerpetualWiggleStorageMigrationWorkload.actor.cpp index 832fef4ca0..664edf61d3 100644 --- a/fdbserver/workloads/PerpetualWiggleStorageMigrationWorkload.actor.cpp +++ b/fdbserver/workloads/PerpetualWiggleStorageMigrationWorkload.actor.cpp @@ -42,6 +42,15 @@ ACTOR Future IssueConfigurationChange(Database cx, std::string config, boo wait(delay(5.0)); // wait for read window return true; } + +constexpr bool hasRocksDB = +#ifdef WITH_ROCKSDB + true +#else + false +#endif + ; + } // namespace struct PerpetualWiggleStorageMigrationWorkload : public TestWorkload { @@ -65,6 +74,10 @@ struct PerpetualWiggleStorageMigrationWorkload : public TestWorkload { Future check(Database const& cx) override { return true; }; ACTOR static Future _start(PerpetualWiggleStorageMigrationWorkload* self, Database cx) { + if (!hasRocksDB) { + // RocksDB, which is required by this test, is not supported + return Void(); + } state std::vector storageServers = wait(getStorageServers(cx)); // The test should have enough storage servers to exclude. ASSERT(storageServers.size() > 3); @@ -227,4 +240,4 @@ struct PerpetualWiggleStorageMigrationWorkload : public TestWorkload { void getMetrics(std::vector& m) override { return; } }; -WorkloadFactory PerpetualWiggleStorageMigrationWorkload; \ No newline at end of file +WorkloadFactory PerpetualWiggleStorageMigrationWorkload;