Add virtual destructor to SpecialKeyRangeBaseImpl
This commit is contained in:
parent
de53322d20
commit
ce0e03a800
|
@ -229,10 +229,10 @@ public:
|
||||||
double detailedHealthMetricsLastUpdated;
|
double detailedHealthMetricsLastUpdated;
|
||||||
|
|
||||||
UniqueOrderedOptionList<FDBTransactionOptions> transactionDefaults;
|
UniqueOrderedOptionList<FDBTransactionOptions> transactionDefaults;
|
||||||
std::shared_ptr<SpecialKeySpace> specialKeySpace;
|
|
||||||
std::shared_ptr<ConflictingKeysImpl> cKImpl;
|
std::vector<std::unique_ptr<SpecialKeyRangeBaseImpl>> specialKeySpaceModules;
|
||||||
std::shared_ptr<ReadConflictRangeImpl> rCRImpl;
|
std::unique_ptr<SpecialKeySpace> specialKeySpace;
|
||||||
std::shared_ptr<WriteConflictRangeImpl> wCRImpl;
|
void registerSpecialKeySpaceModule(std::unique_ptr<SpecialKeyRangeBaseImpl> module);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -493,6 +493,12 @@ ACTOR static Future<HealthMetrics> getHealthMetricsActor(DatabaseContext *cx, bo
|
||||||
Future<HealthMetrics> DatabaseContext::getHealthMetrics(bool detailed = false) {
|
Future<HealthMetrics> DatabaseContext::getHealthMetrics(bool detailed = false) {
|
||||||
return getHealthMetricsActor(this, detailed);
|
return getHealthMetricsActor(this, detailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DatabaseContext::registerSpecialKeySpaceModule(std::unique_ptr<SpecialKeyRangeBaseImpl> module) {
|
||||||
|
specialKeySpace->registerKeyRange(module->getKeyRange(), module.get());
|
||||||
|
specialKeySpaceModules.push_back(std::move(module));
|
||||||
|
}
|
||||||
|
|
||||||
DatabaseContext::DatabaseContext(Reference<AsyncVar<Reference<ClusterConnectionFile>>> connectionFile,
|
DatabaseContext::DatabaseContext(Reference<AsyncVar<Reference<ClusterConnectionFile>>> connectionFile,
|
||||||
Reference<AsyncVar<ClientDBInfo>> clientInfo, Future<Void> clientInfoMonitor,
|
Reference<AsyncVar<ClientDBInfo>> clientInfo, Future<Void> clientInfoMonitor,
|
||||||
TaskPriority taskID, LocalityData const& clientLocality,
|
TaskPriority taskID, LocalityData const& clientLocality,
|
||||||
|
@ -527,10 +533,7 @@ DatabaseContext::DatabaseContext(Reference<AsyncVar<Reference<ClusterConnectionF
|
||||||
transactionsProcessBehind("ProcessBehind", cc), outstandingWatches(0), latencies(1000), readLatencies(1000),
|
transactionsProcessBehind("ProcessBehind", cc), outstandingWatches(0), latencies(1000), readLatencies(1000),
|
||||||
commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000), bytesPerCommit(1000), mvCacheInsertLocation(0),
|
commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000), bytesPerCommit(1000), mvCacheInsertLocation(0),
|
||||||
healthMetricsLastUpdated(0), detailedHealthMetricsLastUpdated(0), internal(internal),
|
healthMetricsLastUpdated(0), detailedHealthMetricsLastUpdated(0), internal(internal),
|
||||||
specialKeySpace(std::make_shared<SpecialKeySpace>(normalKeys.begin, specialKeys.end)),
|
specialKeySpace(std::make_unique<SpecialKeySpace>(normalKeys.begin, specialKeys.end)) {
|
||||||
cKImpl(std::make_shared<ConflictingKeysImpl>(conflictingKeysRange)),
|
|
||||||
rCRImpl(std::make_shared<ReadConflictRangeImpl>(readConflictRangeKeysRange)),
|
|
||||||
wCRImpl(std::make_shared<WriteConflictRangeImpl>(writeConflictRangeKeysRange)) {
|
|
||||||
dbId = deterministicRandom()->randomUniqueID();
|
dbId = deterministicRandom()->randomUniqueID();
|
||||||
connected = clientInfo->get().proxies.size() ? Void() : clientInfo->onChange();
|
connected = clientInfo->get().proxies.size() ? Void() : clientInfo->onChange();
|
||||||
|
|
||||||
|
@ -550,9 +553,9 @@ DatabaseContext::DatabaseContext(Reference<AsyncVar<Reference<ClusterConnectionF
|
||||||
monitorMasterProxiesInfoChange = monitorMasterProxiesChange(clientInfo, &masterProxiesChangeTrigger);
|
monitorMasterProxiesInfoChange = monitorMasterProxiesChange(clientInfo, &masterProxiesChangeTrigger);
|
||||||
clientStatusUpdater.actor = clientStatusUpdateActor(this);
|
clientStatusUpdater.actor = clientStatusUpdateActor(this);
|
||||||
if (apiVersionAtLeast(630)) {
|
if (apiVersionAtLeast(630)) {
|
||||||
specialKeySpace->registerKeyRange(conflictingKeysRange, cKImpl.get());
|
registerSpecialKeySpaceModule(std::make_unique<ConflictingKeysImpl>(conflictingKeysRange));
|
||||||
specialKeySpace->registerKeyRange(readConflictRangeKeysRange, rCRImpl.get());
|
registerSpecialKeySpaceModule(std::make_unique<ReadConflictRangeImpl>(readConflictRangeKeysRange));
|
||||||
specialKeySpace->registerKeyRange(writeConflictRangeKeysRange, wCRImpl.get());
|
registerSpecialKeySpaceModule(std::make_unique<WriteConflictRangeImpl>(writeConflictRangeKeysRange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1290,9 +1290,7 @@ Future< Standalone<RangeResultRef> > ReadYourWritesTransaction::getRange(
|
||||||
bool snapshot,
|
bool snapshot,
|
||||||
bool reverse )
|
bool reverse )
|
||||||
{
|
{
|
||||||
|
|
||||||
if (getDatabase()->apiVersionAtLeast(630)) {
|
if (getDatabase()->apiVersionAtLeast(630)) {
|
||||||
// special key space are only allowed to query if both begin and end are in \xff\xff, \xff\xff\xff
|
|
||||||
if (specialKeys.contains(begin.getKey()) && end.getKey() <= specialKeys.end)
|
if (specialKeys.contains(begin.getKey()) && end.getKey() <= specialKeys.end)
|
||||||
return getDatabase()->specialKeySpace->getRange(Reference<ReadYourWritesTransaction>::addRef(this), begin,
|
return getDatabase()->specialKeySpace->getRange(Reference<ReadYourWritesTransaction>::addRef(this), begin,
|
||||||
end, limits, reverse);
|
end, limits, reverse);
|
||||||
|
|
|
@ -44,6 +44,8 @@ public:
|
||||||
ACTOR Future<Void> normalizeKeySelectorActor(const SpecialKeyRangeBaseImpl* pkrImpl,
|
ACTOR Future<Void> normalizeKeySelectorActor(const SpecialKeyRangeBaseImpl* pkrImpl,
|
||||||
Reference<ReadYourWritesTransaction> ryw, KeySelector* ks);
|
Reference<ReadYourWritesTransaction> ryw, KeySelector* ks);
|
||||||
|
|
||||||
|
virtual ~SpecialKeyRangeBaseImpl() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
KeyRange range; // underlying key range for this function
|
KeyRange range; // underlying key range for this function
|
||||||
};
|
};
|
||||||
|
|
|
@ -75,7 +75,7 @@ struct SpecialKeySpaceCorrectnessWorkload : TestWorkload {
|
||||||
double getCheckTimeout() override { return std::numeric_limits<double>::max(); }
|
double getCheckTimeout() override { return std::numeric_limits<double>::max(); }
|
||||||
|
|
||||||
Future<Void> _setup(Database cx, SpecialKeySpaceCorrectnessWorkload* self) {
|
Future<Void> _setup(Database cx, SpecialKeySpaceCorrectnessWorkload* self) {
|
||||||
cx->specialKeySpace = std::make_shared<SpecialKeySpace>();
|
cx->specialKeySpace = std::make_unique<SpecialKeySpace>();
|
||||||
if (self->clientId == 0) {
|
if (self->clientId == 0) {
|
||||||
self->ryw = Reference(new ReadYourWritesTransaction(cx));
|
self->ryw = Reference(new ReadYourWritesTransaction(cx));
|
||||||
self->ryw->setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_RELAXED);
|
self->ryw->setOption(FDBTransactionOptions::SPECIAL_KEY_SPACE_RELAXED);
|
||||||
|
|
Loading…
Reference in New Issue