Repository navigation
Conversation
Pass original callback to kConnect, and kConnect as callback to super._open
Still needs work, the ClassicLevel db doesn't open properly
Refactor to classic-level 2.0 API
Author
|
@vweevers hi there! Just wanted to touch base on this and see if you have any questions for me about this PR, or if there's anything I can do to help move it along? Not trying to be a bother, just checking in! |
…process with fallover
Fix failover reconnection, improve tests
Support getSync for rave-level followers, refactor connection flow
…ossible While the database was still opening, a failed attempt to open the underlying classic-level database (corruption, IO error, or a lock held for the whole retry window while nobody answered on the socket) was handed to kDestroy, which only emits when the status is "open". The error was dropped, _open() resolved, and the instance was left neither leader nor follower: every later operation was queued for a leader that never came and hung forever. Foundry never saw an error and therefore never ran its database repair. Throw the underlying classic-level error instead while opening, so that db.open() rejects with LEVEL_DATABASE_NOT_OPEN and that error as cause, deferred operations are rejected, and the database ends up closed, the same way classic-level itself behaves. During failover (status "open") the error is still emitted as before. Also start the lock retry window at the beginning of every connection attempt instead of only the first one, so a failover after a leader closed does not give up immediately.
…eouts Review feedback on the previous commit: The retry window reset was reverted. kConnect is only re-entered after a follower's connection to a leader closed, and onconnect already clears the timestamp in that case, so setting it unconditionally at the start of kConnect changed nothing in practice and was not worth the doubt. The timeout check keeps its original guard, only inverted to read as "still within the window". tape does not time out on its own and the bug under test is a hang, so every await that would stall on a regression now races a timeout and fails with a message instead of stalling the suite.
Reject open() when neither a leader connection nor a leader open is possible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates
rave-levelto conform to theabstract-level2.0 APIs. It requires Level/many-level#13. Currently it installs our fork ofmany-level, but of course that should be updated to use the official npm package once it is ready.In general, this means everything has been converted from callbacks to promises. Unfortunately it does not encompass all of the work required to update rave-level; our use case does not use all of the features of
rave-level, so due to limited time and competing priorities I had to forego solving several test failures which do not affect our use case.A few notable changes:
abstract-level2.0.rave-level1.0.While this isn't a complete update in and of itself, I hope this serves useful on the road to 2.0!