cockroach
cockroach copied to clipboard
rule: changed two dep rules
Commit 1: changed two existing dep rules slightly as to not cause any functional changes, but it's necessary for the next commit.
Commit 2: added a dep rule between the new primary index and the
new secondary index in ADD COLUMN, which requires the new
secondary index to become PUBLIC right before the new primary
index becomes PUBLIC (i.e. the primary index swap).
Fixes #82953
Release note: None
I didn't fully understand the fix in the previous iteration and came up with a dep rule that didn't actually solve the problem. That dep rule delays the primary index swap and column turning public to happen in the same stage as the new unique secondary index turning public. This is not right because we would never be able to backfill the new unique secondary index to begin with, because that new column is not present in the (old) primary index. The reason we had such a requirement is definitely not obvious: it's related to an assumption that the optimizer holds deeply in the code and it's not easy to change any time soon. See this slack discussion for more details with an example included there.
The alternative @ajwerner suggested is to mark the transition of the column element into public non-revertible. What this entails is that we would respect the requirement by swapping the primary index first while keeping the column in WRITE_ONLY. We then backfill the new unique secondary index. Finally, in the non-revertible phase, we transition the column and the new unique secondary index into public in the same stage.
Whatever it takes. Regardless of this particular issue, I believe that making the column public a non-revertible op makes sense anyway. Go for it!
The only failed test in CI is marked by TeamCity as "flaky", so I think it's RFAL!
TFTR!
bors r+
blathers backport 22.2 22.2.0
Encountered an error creating backports. Some common things that can go wrong:
- The backport branch might have already existed.
- There was a merge conflict.
- The backport branch contained merge commits.
You might need to create your backport manually using the backport tool.
error creating merge commit from 32b766a4bab1da2d5e9dd56db540797d8cee934d to blathers/backport-release-22.2-88489: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []
you may need to manually resolve merge conflicts with the backport tool.
Backport to branch 22.2 failed. See errors above.
error creating merge commit from 32b766a4bab1da2d5e9dd56db540797d8cee934d to blathers/backport-release-22.2.0-88489: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []
you may need to manually resolve merge conflicts with the backport tool.
Backport to branch 22.2.0 failed. See errors above.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.