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

release-22.1: storage: lock database before initializing encryption-at-rest #104141

Merged
merged 1 commit into from May 31, 2023

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented May 31, 2023

22.1 backport of cockroachdb/pebble#2498.


Previously, it was possible to corrupt the encryption-at-rest state of a store by running commands that manipulate store state without first terminating the store's Cockroach process. Cockroach uses a file lock to provide mutual exclusion between processes. Previously, this file lock was acquired when the Pebble engine was opened. The engine is opened only after the encryption-at-rest environment has been initialized, including rotating the file registry. This corruption required replacing the entire corrupted store.

Fix an issue whereby encryption-at-rest disk state was not protectthe file lock that prevents

Fix #98294.
Release justification: Fixes node-local encryption-at-rest corruption issue.
Release note (bug fix): Fix bug whereby running a debug command that manipulates a store (eg, debug compact) without first terminating the node using the store could result in corruption of the node's store if encryption-at-rest was enabled.

@jbowens jbowens requested a review from a team as a code owner May 31, 2023 13:51
@jbowens jbowens requested a review from RaduBerinde May 31, 2023 13:51
@blathers-crl
Copy link

blathers-crl bot commented May 31, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Previously, it was possible to corrupt the encryption-at-rest state of a store
by running commands that manipulate store state without first terminating the
store's Cockroach process. Cockroach uses a file lock to provide mutual
exclusion between processes. Previously, this file lock was acquired when the
Pebble engine was opened. The engine is opened only after the
encryption-at-rest environment has been initialized, including rotating the
file registry. This corruption required replacing the entire corrupted store.

Fix an issue whereby encryption-at-rest disk state was not protectthe file lock
that prevents

Fix cockroachdb#98294.
Release note (bug fix): Fix bug whereby running a debug command that
manipulates a store (eg, `debug compact`) without first terminating the node
using the store could result in corruption of the node's store if
encryption-at-rest was enabled.
@jbowens jbowens changed the title storage: lock database before initializing encryption-at-rest release-22.1: storage: lock database before initializing encryption-at-rest May 31, 2023
@jbowens jbowens merged commit 276b5d4 into cockroachdb:release-22.1 May 31, 2023
5 of 6 checks passed
@jbowens jbowens deleted the 22.1-1ef0d356 branch May 31, 2023 14:38
@jbowens
Copy link
Collaborator Author

jbowens commented May 31, 2023

tftr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants