Merge pull request #1782 from etschannen/master

revert storage server priority changes
This commit is contained in:
Evan Tschannen 2019-07-02 17:25:31 -07:00 committed by GitHub
commit 8afab93e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -2865,11 +2865,11 @@ ACTOR Future<Void> updateStorage(StorageServer* data) {
if (g_network->isSimulated()) {
double endTime = g_simulator.checkDisabled(format("%s/updateStorage", data->thisServerID.toString().c_str()));
if(endTime > now()) {
wait(delay(endTime - now(), TaskStorage));
wait(delay(endTime - now(), TaskUpdateStorage));
}
}
wait( data->desiredOldestVersion.whenAtLeast( data->storageVersion()+1 ) );
wait( delay(0, TaskStorage) );
wait( delay(0, TaskUpdateStorage) );
state Promise<Void> durableInProgress;
data->durableInProgress = durableInProgress.getFuture();
@ -2884,10 +2884,10 @@ ACTOR Future<Void> updateStorage(StorageServer* data) {
state bool done = data->storage.makeVersionMutationsDurable(newOldestVersion, desiredVersion, bytesLeft);
// We want to forget things from these data structures atomically with changing oldestVersion (and "before", since oldestVersion.set() may trigger waiting actors)
// forgetVersionsBeforeAsync visibly forgets immediately (without waiting) but asynchronously frees memory.
Future<Void> finishedForgetting = data->mutableData().forgetVersionsBeforeAsync( newOldestVersion, TaskStorage );
Future<Void> finishedForgetting = data->mutableData().forgetVersionsBeforeAsync( newOldestVersion, TaskUpdateStorage );
data->oldestVersion.set( newOldestVersion );
wait( finishedForgetting );
wait( yield(TaskStorage) );
wait( yield(TaskUpdateStorage) );
if (done) break;
}
@ -2900,9 +2900,7 @@ ACTOR Future<Void> updateStorage(StorageServer* data) {
state Future<Void> durableDelay = Void();
if (bytesLeft > 0) {
durableDelay = delay(SERVER_KNOBS->STORAGE_COMMIT_INTERVAL, TaskStorage);
} else {
durableDelay = delay(0, TaskUpdateStorage) || delay(SERVER_KNOBS->STORAGE_COMMIT_INTERVAL, TaskStorage);
durableDelay = delay(SERVER_KNOBS->STORAGE_COMMIT_INTERVAL, TaskUpdateStorage);
}
wait( durable );
@ -2922,7 +2920,7 @@ ACTOR Future<Void> updateStorage(StorageServer* data) {
}
durableInProgress.send(Void());
wait( delay(0, TaskStorage) ); //Setting durableInProgess could cause the storage server to shut down, so delay to check for cancellation
wait( delay(0, TaskUpdateStorage) ); //Setting durableInProgess could cause the storage server to shut down, so delay to check for cancellation
// Taking and releasing the durableVersionLock ensures that no eager reads both begin before the commit was effective and
// are applied after we change the durable version. Also ensure that we have to lock while calling changeDurableVersion,
@ -2931,9 +2929,9 @@ ACTOR Future<Void> updateStorage(StorageServer* data) {
data->popVersion( data->durableVersion.get() + 1 );
while (!changeDurableVersion( data, newOldestVersion )) {
if(g_network->check_yield(TaskStorage)) {
if(g_network->check_yield(TaskUpdateStorage)) {
data->durableVersionLock.release();
wait(delay(0, TaskStorage));
wait(delay(0, TaskUpdateStorage));
wait( data->durableVersionLock.take() );
}
}

View File

@ -65,8 +65,6 @@ enum {
TaskDefaultOnMainThread = 7500,
TaskDefaultDelay = 7010,
TaskDefaultYield = 7000,
TaskDiskWrite = 5030,
TaskStorage = 5020,
TaskDiskRead = 5010,
TaskDefaultEndpoint = 5000,
TaskUnknownEndpoint = 4000,
@ -74,6 +72,7 @@ enum {
TaskDataDistributionLaunch = 3530,
TaskRatekeeper = 3510,
TaskDataDistribution = 3500,
TaskDiskWrite = 3010,
TaskUpdateStorage = 3000,
TaskTLogSpilledPeekReply = 2800,
TaskLowPriority = 2000,