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

DM-36172: Add explicit transaction around moveToTrash calls #733

Merged
merged 4 commits into from Sep 13, 2022

Conversation

timj
Copy link
Member

@timj timj commented Sep 9, 2022

Without this the in-memory datastore can not rollback a datastore.trash() call.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Modern mypy does not want it.
@timj timj requested a review from TallJimbo September 9, 2022 22:22
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 84.69% // Head: 84.68% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (3c82a35) compared to base (f64fe52).
Patch coverage: 84.61% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #733      +/-   ##
==========================================
- Coverage   84.69%   84.68%   -0.02%     
==========================================
  Files         244      244              
  Lines       32141    32156      +15     
  Branches     6034     6040       +6     
==========================================
+ Hits        27222    27230       +8     
- Misses       3745     3752       +7     
  Partials     1174     1174              
Impacted Files Coverage Δ
...thon/lsst/daf/butler/registry/bridge/monolithic.py 83.67% <50.00%> (-0.87%) ⬇️
...hon/lsst/daf/butler/registry/interfaces/_bridge.py 72.50% <50.00%> (-0.92%) ⬇️
...ython/lsst/daf/butler/registry/bridge/ephemeral.py 84.09% <70.00%> (-4.80%) ⬇️
python/lsst/daf/butler/_butler.py 80.23% <88.46%> (+0.08%) ⬆️
python/lsst/daf/butler/datastores/fileDatastore.py 80.34% <100.00%> (-0.77%) ⬇️
...on/lsst/daf/butler/datastores/inMemoryDatastore.py 84.37% <100.00%> (+0.16%) ⬆️
tests/test_butler.py 97.61% <100.00%> (ø)
...thon/lsst/daf/butler/core/datastoreCacheManager.py 80.74% <0.00%> (+0.53%) ⬆️
python/lsst/daf/butler/core/datastore.py 79.09% <0.00%> (+1.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've requested some adjustments that I do think need to be made, but I think they're straightforward (and I'm about to disappear), so I'm happy to let you take it from here.

python/lsst/daf/butler/registry/bridge/ephemeral.py Outdated Show resolved Hide resolved
tests/test_butler.py Show resolved Hide resolved
python/lsst/daf/butler/_butler.py Outdated Show resolved Hide resolved
Butler does not know that a registry transaction is sufficient.

This also add a transaction parameter to bridge moveToTrash method
to make use of that new transaction context.

Without this there is no way for the ephemeral bridge to roll
back a transaction from a failure in registry. This works for
the normal bridge because that is also using a shared
database transaction.
@timj timj merged commit 4ca570b into main Sep 13, 2022
@timj timj deleted the tickets/DM-36172 branch September 13, 2022 22:02
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

2 participants