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

glusterd: avoid starting the same brick twice #4088

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Commits on Mar 29, 2023

  1. glusterd: avoid starting the same brick twice

    There was a race in glusterd code that could cause that two threads
    start the same brick at the same time. One of the bricks will fail
    because it will detect the other brick running. Depending on which
    brick fails, glusterd will report a start failure and mark the brick
    as stopped even if it's running.
    
    The problem is caused by an attempt to connect to a brick that's being
    started by another thread. If the brick is not fully initialized, it
    will refuse all connection attempts. When this happens, glusterd receives
    a disconnection notification, which forcibly marks the brick as stopped.
    
    Now, if another attempt to start the same brick happens, it will believe
    that the brick is stopped and it will start it again. If this happens
    very soon after the first start attempt, the checks done to see if the
    brick is already running will still fail, triggering the start of the
    brick process again. One of the bricks will fail to initialize and will
    report an error. If the failed one is processed by glusterd in the
    second place, the brick will be marked as stopped, even though the
    process is actually there and working.
    
    Fixes: gluster#4080
    Signed-off-by: Xavi Hernandez <[email protected]>
    xhernandez committed Mar 29, 2023
    Configuration menu
    Copy the full SHA
    12bca84 View commit details
    Browse the repository at this point in the history