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

disk storage + delta + snapshot bundles #4900

Closed
srenatus opened this issue Jul 18, 2022 · 0 comments · Fixed by #4952
Closed

disk storage + delta + snapshot bundles #4900

srenatus opened this issue Jul 18, 2022 · 0 comments · Fixed by #4952
Assignees
Labels

Comments

@srenatus
Copy link
Contributor

There's an issue with transaction handling when snapshot bundles are written to the store: intermittent write to the transaction for delta bundles and old bundle erasure would be lost because the first write transaction is never committed.

  • Introduced: 0.42.0, 0.42.1 and 0.42.2 are also affected.
@srenatus srenatus added the bug label Jul 18, 2022
@ashutosh-narkar ashutosh-narkar self-assigned this Jul 18, 2022
ashutosh-narkar added a commit to ashutosh-narkar/opa that referenced this issue Aug 15, 2022
Currently we backup the disk store and apply new bundle policy
and data on the new store. Since truncate is called within
a transaction, any uncommited changes on the store will not
be seen during the backup. For example, if the old bundle
data was erased prior to activating a new bundle, this change
would still be uncommited when the backup is done and as a
result both the old and new data would exist in the store.
To avoid this, we now backup the current store, then commit any
in-flight transactions on the current store and store the
current bundle on the store. The backup can be used if we need
to restore to the orignal store version in case we need to
abort the transaction.

Fixes: open-policy-agent#4900

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
ashutosh-narkar added a commit that referenced this issue Aug 15, 2022
Currently we backup the disk store and apply new bundle policy
and data on the new store. Since truncate is called within
a transaction, any uncommited changes on the store will not
be seen during the backup. For example, if the old bundle
data was erased prior to activating a new bundle, this change
would still be uncommited when the backup is done and as a
result both the old and new data would exist in the store.
To avoid this, we now backup the current store, then commit any
in-flight transactions on the current store and store the
current bundle on the store. The backup can be used if we need
to restore to the orignal store version in case we need to
abort the transaction.

Fixes: #4900

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants