Skip to content

Commit

Permalink
Disable recurring sync processing in snapback (#3332)
Browse files Browse the repository at this point in the history
  • Loading branch information
theoilie authored Jun 28, 2022
1 parent 123688a commit 59420a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 11 additions & 9 deletions creator-node/src/snapbackSM/snapbackSM.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,18 @@ class SnapbackSM {
)

// Initialize recurringSyncQueue job processor
this.recurringSyncQueue.process(
this.MaxRecurringRequestSyncJobConcurrency,
async (job) => {
try {
await this.processSyncOperation(job, SyncType.Recurring)
} catch (e) {
this.logError(`RecurringSyncQueue processing error ${e}`)
if (!this.nodeConfig.get('disableSnapback')) {
this.recurringSyncQueue.process(
this.MaxRecurringRequestSyncJobConcurrency,
async (job) => {
try {
await this.processSyncOperation(job, SyncType.Recurring)
} catch (e) {
this.logError(`RecurringSyncQueue processing error ${e}`)
}
}
}
)
)
}
this.inittedJobProcessors = true
}

Expand Down
1 change: 1 addition & 0 deletions creator-node/test/snapbackSM.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ describe('test SnapbackSM -- determineNewReplicaSet, sync queue, and reconfig mo
const MaxRecurringRequestSyncJobConcurrency = 1
nodeConfig.set('maxManualRequestSyncJobConcurrency', MaxManualRequestSyncJobConcurrency)
nodeConfig.set('maxRecurringRequestSyncJobConcurrency', MaxRecurringRequestSyncJobConcurrency)
nodeConfig.set('disableSnapback', false)

// Mock out the initial call to sync
nock(constants.secondary1Endpoint)
Expand Down

0 comments on commit 59420a4

Please sign in to comment.