Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix.skip run always #5421

Open
wants to merge 1 commit into
base: release/1.40.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions jobsdb/jobsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@
backup struct {
masterBackupEnabled config.ValueLoader[bool]
}
// skipRunAlways determines whether to skip running the "always" changesets
skipRunAlways config.ValueLoader[bool]
}
}

Expand Down Expand Up @@ -853,14 +855,17 @@
jd.setupDatabaseTables(templateData)
}

// Run changesets that should always run for both writer and reader jobsdbs.
//
// When running separate gw and processor instances we cannot control the order of execution
// and we cannot guarantee that after a gw migration completes, processor
// will not create new tables using the old schema.
//
// Changesets that run always can help in such cases, by bringing non-migrated tables into a usable state.
jd.runAlwaysChangesets(templateData)
// Only run the always changesets if skipRunAlways is false
if !jd.conf.skipRunAlways.Load() {
// Run changesets that should always run for both writer and reader jobsdbs.
//
// When running separate gw and processor instances we cannot control the order of execution
// and we cannot guarantee that after a gw migration completes, processor
// will not create new tables using the old schema.
//
// Changesets that run always can help in such cases, by bringing non-migrated tables into a usable state.
jd.runAlwaysChangesets(templateData)
}

Check warning on line 868 in jobsdb/jobsdb.go

View check run for this annotation

Codecov / codecov/patch

jobsdb/jobsdb.go#L868

Added line #L868 was not covered by tests

// finally refresh the dataset list to make sure [datasetList] field is populated
err := jd.doRefreshDSRangeList(l)
Expand Down Expand Up @@ -957,6 +962,12 @@
true, "JobsDB.backup.enabled",
)

// skipRunAlways determines whether to skip running the "always" changesets
// Default to false to maintain backward compatibility
jd.conf.skipRunAlways = jd.config.GetReloadableBoolVar(
true, "JobsDB.skipRunAlways",
)

// maxDSSize: Maximum size of a DS. The process which adds new DS runs in the background
// (every few seconds) so a DS may go beyond this size
// passing `maxDSSize` by reference, so it can be hot reloaded
Expand Down
Loading