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

Race condition in set_state #2727

Closed
alexstanovoy opened this issue Nov 1, 2022 · 4 comments
Closed

Race condition in set_state #2727

alexstanovoy opened this issue Nov 1, 2022 · 4 comments
Assignees
Labels
c/storage/pageserver Component: storage: pageserver t/bug Issue Type: Bug triaged bugs that were already triaged

Comments

@alexstanovoy
Copy link
Contributor

alexstanovoy commented Nov 1, 2022

Code link

Let's imagine we have not only Active and Paused states, but also some valid Active2 state. Steps to reproduce:

  1. self.current_state() returns Active for the first thread.
  2. self.current_state() returns Active for the second thread.
  3. The first thread changes the state to Paused according to the match.
  4. The second thread changes the state to Active2 according to the match.

Without the Active2 state, it's currently impossible to reproduce. But it could be a problem when the new state appears.

@alexstanovoy alexstanovoy added t/bug Issue Type: Bug c/storage/pageserver Component: storage: pageserver labels Nov 1, 2022
@LizardWizzard
Copy link
Contributor

Related WIP PR: #2665. TLDR: we can use send_if_modified to perform the match under watchs internal RWLock

@hlinnaka
Copy link
Contributor

Is this the same as #2003 ?

@shanyp shanyp added the triaged bugs that were already triaged label Mar 23, 2023
@koivunej
Copy link
Member

koivunej commented May 8, 2023

Noted that this issue no longer points to any sensible location in code. The Sender::send_modify is now being used through out per earlier comment #2727 (comment).

@hlinnaka
Copy link
Contributor

The code has changed a lot since this issue was created. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/storage/pageserver Component: storage: pageserver t/bug Issue Type: Bug triaged bugs that were already triaged
Projects
None yet
Development

No branches or pull requests

6 participants