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

wtclient: ability to mark a session as borked #7545

Closed

Conversation

ellemouton
Copy link
Collaborator

@ellemouton ellemouton commented Mar 29, 2023

With this PR, watchtower clients now have the ability to force a session to be
marked as "borked". This means that if the server ever returns session errors
that cause updates to not be backed up (like in #6397), the a user can force
the session to be aborted.

This commit adds a test that demonstrates that a client is unable to
continue backing up states to the server if any session errors occur.
This will be addressed/fixed in the upcoming commits.
Let the StopAndRemove method return false if a session with the given ID
was not found in the queue set. This will be used in an upcoming commit.
A new CSessionBorked status is to represent a session that is should be
seen as permanently inactive. Various methods are also updated:
- The isSessionClosable methods are updated so that sessions need to be
  either exhausted _or_ borked in order to considered closable.
- The ExhaustedSessionFilter function is also updated to filter out
  borked sessions.
- The markSessionStatus method is updated to make sure that a session
  marked as borked cannot be marked as inactive or active.
In preparation for the use of this variable in other packages, it is
exported in this commit.
Add a new MarkSessionBorked method to the wtclient DB and add a test to
assert the behaviour.
This commit adds a Stopped method to the sessionQueue which returns a
channel that can be listened on for a signal that the queue has stopped
its operations. This tells the backupDispatcher that it should pick or
negotiate a new active session queue.
This commit adds the MarkSessionBorked method to the TowerClient and
then demonstrate in a test that this method allows a user to force the
abort of an erroring session so that a new one can be negotiated.
@ellemouton
Copy link
Collaborator Author

replaced by: #8239

@ellemouton ellemouton closed this Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 MUST be fixed or reviewed watchtower
Projects
None yet
2 participants