File tree 3 files changed +11
-12
lines changed 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -7274,22 +7274,23 @@ class FileBackupAgentImpl {
7274
7274
7275
7275
ACTOR static Future<Void> changePause (FileBackupAgent* backupAgent, Database db, bool pause) {
7276
7276
state Reference<ReadYourWritesTransaction> tr (new ReadYourWritesTransaction (db));
7277
- state Future<Void> change = backupAgent->taskBucket ->changePause (db, pause );
7278
7277
7279
7278
loop {
7280
7279
tr->setOption (FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
7281
7280
tr->setOption (FDBTransactionOptions::LOCK_AWARE);
7282
7281
tr->setOption (FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE);
7283
7282
7284
7283
try {
7284
+ // This is the pause key is in the task bucket, for backup agents
7285
+ backupAgent->taskBucket ->changePause (tr, pause );
7286
+ // This is backup workers' pause key.
7285
7287
tr->set (backupPausedKey, pause ? " 1" _sr : " 0" _sr);
7286
7288
wait (tr->commit ());
7287
7289
break ;
7288
7290
} catch (Error& e) {
7289
7291
wait (tr->onError (e));
7290
7292
}
7291
7293
}
7292
- wait (change);
7293
7294
TraceEvent (" FileBackupAgentChangePaused" ).detail (" Action" , pause ? " Paused" : " Resumed" );
7294
7295
return Void ();
7295
7296
}
Original file line number Diff line number Diff line change @@ -118,11 +118,9 @@ struct BackupWorkload : TestWorkload {
118
118
119
119
// Resume the backup agent if it is paused
120
120
ACTOR static Future<Void> resumeAgent (Database cx, FileBackupAgent* backupAgent) {
121
- bool active = wait (backupAgent->checkActive (cx));
122
- if (!active) {
123
- wait (backupAgent->changePause (cx, false ));
124
- TraceEvent (" BW_AgentResumed" ).log ();
125
- }
121
+ TraceEvent (" BW_AgentResuming" ).log ();
122
+ wait (backupAgent->changePause (cx, false ));
123
+ TraceEvent (" BW_AgentResumed" ).log ();
126
124
return Void ();
127
125
}
128
126
Original file line number Diff line number Diff line change @@ -111,10 +111,9 @@ struct RestoreWorkload : TestWorkload {
111
111
112
112
// Resume the backup agent if it is paused
113
113
ACTOR static Future<Void> resumeAgent (Database cx, FileBackupAgent* backupAgent) {
114
- bool active = wait (backupAgent->checkActive (cx));
115
- if (!active) {
116
- wait (backupAgent->changePause (cx, false ));
117
- }
114
+ TraceEvent (" RW_AgentResuming" ).log ();
115
+ wait (backupAgent->changePause (cx, false ));
116
+ TraceEvent (" RW_AgentResumed" ).log ();
118
117
return Void ();
119
118
}
120
119
@@ -137,7 +136,8 @@ struct RestoreWorkload : TestWorkload {
137
136
state DatabaseConfiguration config = wait (getDatabaseConfiguration (cx));
138
137
TraceEvent (" RW_Arguments" )
139
138
.detail (" BackupTag" , printable (self->backupTag ))
140
- .detail (" PerformRestore" , self->performRestore );
139
+ .detail (" PerformRestore" , self->performRestore )
140
+ .detail (" AllowPauses" , self->allowPauses );
141
141
142
142
if (self->allowPauses && BUGGIFY) {
143
143
cp = changePaused (cx, &backupAgent);
You can’t perform that action at this time.
0 commit comments