-
Notifications
You must be signed in to change notification settings - Fork 333
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
feat(mito): Add writable flag to region #2349
feat(mito): Add writable flag to region #2349
Conversation
931d4cb
to
0cecae3
Compare
50cea29
to
f1f7824
Compare
0cecae3
to
94d1355
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2349 +/- ##
===========================================
- Coverage 77.49% 77.48% -0.02%
===========================================
Files 716 716
Lines 113735 113827 +92
===========================================
+ Hits 88141 88197 +56
- Misses 25594 25630 +36 |
Is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* feat: add writable flag to region. * refactor: rename MitoEngine to MitoEngine::scanner * feat: add set_writable() to RegionEngine * feat: check whether region is writable * feat: make set_writable sync * test: test set_writable * docs: update comments * feat: send result on compaction failure * refactor: wrap output sender in new type * feat: on failure * refactor: use get_region_or/writable_region_or * refactor: remove send_result * feat: notify waiters on flush scheduler drop * test: fix tests * fix: only alter writable region
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
This PR adds a
writable
flag to each mito region and aset_writable()
method toRegionEngine
traitset_writable()
to mark the region as writableNote that the
writable
flag is a simple atomic flag, so it can't guarantee that the engine immediately cancels all running write operations.Refactor
Sender<Result<Output>>
andOption<Sender<Result<Output>>>
into new typesOutputTx
andOptionOutputtx
.get_region_or()
andwritable_region_or()
. They invoke theOnFailure
callback if the region is unavailable.The we can refactor the following code:
With
writable_region_or()
Checklist
Refer to a related PR or issue link (optional)