mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
adding system priority option to getDatabaseConfiguration, and several debugging improvements (#9864)
This commit is contained in:
parent
396f89a3f4
commit
aef5130da2
@ -673,7 +673,10 @@ TEST_CASE("/ManagementAPI/ChangeConfig/TenantAndEncryptMode") {
|
||||
return Void();
|
||||
}
|
||||
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Transaction* tr) {
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Transaction* tr, bool useSystemPriority) {
|
||||
if (useSystemPriority) {
|
||||
tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE);
|
||||
}
|
||||
tr->setOption(FDBTransactionOptions::READ_LOCK_AWARE);
|
||||
tr->setOption(FDBTransactionOptions::READ_SYSTEM_KEYS);
|
||||
RangeResult res = wait(tr->getRange(configKeys, CLIENT_KNOBS->TOO_MANY));
|
||||
@ -683,11 +686,11 @@ ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Transaction* tr) {
|
||||
return config;
|
||||
}
|
||||
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Database cx) {
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Database cx, bool useSystemPriority) {
|
||||
state Transaction tr(cx);
|
||||
loop {
|
||||
try {
|
||||
DatabaseConfiguration config = wait(getDatabaseConfiguration(&tr));
|
||||
DatabaseConfiguration config = wait(getDatabaseConfiguration(&tr, useSystemPriority));
|
||||
return config;
|
||||
} catch (Error& e) {
|
||||
wait(tr.onError(e));
|
||||
|
@ -41,8 +41,8 @@ standard API and some knowledge of the contents of the system key space.
|
||||
#include "fdbclient/MonitorLeader.h"
|
||||
#include "flow/actorcompiler.h" // has to be last include
|
||||
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Transaction* tr);
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Database cx);
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Transaction* tr, bool useSystemPriority = false);
|
||||
ACTOR Future<DatabaseConfiguration> getDatabaseConfiguration(Database cx, bool useSystemPriority = false);
|
||||
ACTOR Future<Void> waitForFullReplication(Database cx);
|
||||
|
||||
struct IQuorumChange : ReferenceCounted<IQuorumChange> {
|
||||
|
@ -5522,16 +5522,20 @@ ACTOR Future<Void> blobWorker(BlobWorkerInterface bwInterf,
|
||||
state Reference<BlobWorkerData> self(new BlobWorkerData(bwInterf.id(), dbInfo, cx, persistentData));
|
||||
self->id = bwInterf.id();
|
||||
self->locality = bwInterf.locality;
|
||||
|
||||
TraceEvent("BlobWorkerInitStart", self->id).detail("Recovering", false).log();
|
||||
|
||||
try {
|
||||
// Since the blob worker gets initalized through the blob manager it is more reliable to fetch the encryption
|
||||
// state using the DB Config rather than passing it through the initalization request for the blob manager and
|
||||
// blob worker
|
||||
state Future<DatabaseConfiguration> configFuture = getDatabaseConfiguration(cx);
|
||||
state Future<DatabaseConfiguration> configFuture = getDatabaseConfiguration(cx, true);
|
||||
|
||||
if (self->storage) {
|
||||
wait(self->storage->init());
|
||||
self->storage->set(KeyValueRef(persistID, BinaryWriter::toValue(self->id, Unversioned())));
|
||||
wait(self->storage->commit());
|
||||
TraceEvent("BlobWorkerStorageInitComplete", self->id).log();
|
||||
}
|
||||
|
||||
if (BW_DEBUG) {
|
||||
@ -5604,6 +5608,8 @@ ACTOR Future<Void> blobWorker(BlobWorkerInterface bwInterf,
|
||||
state Reference<BlobWorkerData> self(new BlobWorkerData(bwInterf.id(), dbInfo, cx, persistentData));
|
||||
self->id = bwInterf.id();
|
||||
self->locality = bwInterf.locality;
|
||||
TraceEvent("BlobWorkerInitStart", self->id).detail("Recovering", true).log();
|
||||
|
||||
try {
|
||||
wait(self->storage->init());
|
||||
wait(self->storage->commit());
|
||||
@ -5616,7 +5622,7 @@ ACTOR Future<Void> blobWorker(BlobWorkerInterface bwInterf,
|
||||
// Since the blob worker gets initalized through the blob manager it is more reliable to fetch the encryption
|
||||
// state using the DB Config rather than passing it through the initalization request for the blob manager and
|
||||
// blob worker
|
||||
state Future<DatabaseConfiguration> configFuture = getDatabaseConfiguration(cx);
|
||||
state Future<DatabaseConfiguration> configFuture = getDatabaseConfiguration(cx, true);
|
||||
|
||||
if (BW_DEBUG) {
|
||||
printf("Initializing blob worker s3 stuff\n");
|
||||
|
@ -353,7 +353,9 @@ public:
|
||||
TraceEvent("RkMinBlobWorkerVersion")
|
||||
.detail("BWVersion", minVer)
|
||||
.detail("MaxVer", self->maxVersion)
|
||||
.detail("MinId", blobWorkers.size() > 0 ? blobWorkers[minIdx].id() : UID());
|
||||
.detail("MinId", blobWorkers.size() > 0 ? blobWorkers[minIdx].id() : UID())
|
||||
.detail("BMBlocked",
|
||||
now() - self->unblockedAssignmentTime >= SERVER_KNOBS->BW_MAX_BLOCKED_INTERVAL);
|
||||
}
|
||||
}
|
||||
wait(blobWorkerDelay);
|
||||
|
Loading…
x
Reference in New Issue
Block a user