Relax singleton-context constraint for pending non-singleton-context reverts #10114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When a migration runs with -singleton-context ddl strategy flag, and with context
A
, then another migration with-singleton-context
can only be submitted if it has same contextA
, and cannot be submitted if it has contextB
. Note, the submission itself returns with an error.We want to have better user experience when it comes to reverts. Reverts may be long running and are allowed to run concurrently to other migrations.
A REVERT can run without a
-singleton-context
flag. In fact, this is the canonical way of running it. So we do not fail submitting a REVERT even if there are pending migrations.However, what happens when a REVERT is already running, and a new migration comes in?
Starting this PR, the following holds true:
-singleton-context
-singleton-context
and with some arbitrarymigration_context
.To clarify:
-singleton-context
flag with some-migration_context=A
-singleton-context
flag may only be submitted it it also has-migration_context=A
, and it will be rejected if it has-migration_context=B
The reason we add this relaxation is that we see an operational pattern in usage, and this behavior makes sense operationally.
Documentation to follow.
Related Issue(s)
-singleton-context
flag #7946Checklist