Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

stale brick process when volume stop operations are done in parallel in brick multiplexing mode #1470

Open
atinmu opened this issue Jan 8, 2019 · 8 comments
Labels
brick-multiplexing-issue tracker label to capture all issues related to brick multiplexing feature bug priority: high

Comments

@atinmu
Copy link
Contributor

atinmu commented Jan 8, 2019

During stopBricks () , if we happen to send the volume stop requests in parallel, GD2 might fail to determine the last brick in the proc entry because -
Given it tries to match if for the given path if portmapper has only one entry, the sign out even might be processed later and even though it's the last brick to be detached function IsLastBrickInProc () will return > 1.

We should be moving towards a list based approach to store (in memory) all the bricks attached to the parent process and then build up the logic.

@atinmu atinmu changed the title stale brick process when volume stop operations are done in parallel stale brick process when volume stop operations are done in parallel in brick multiplexing mode Jan 8, 2019
@vpandey-RH
Copy link
Contributor

@atinmu I am having trouble understanding how a list might help. The portmapper we use currently is kind of an in-memory multi list itself.

@atinmu
Copy link
Contributor Author

atinmu commented Jan 9, 2019

I am having trouble understanding how a list might help. The portmapper we use currently is kind of an in-memory multi list itself.

portmapper is an in-memory data structure, however the values in the data structure are (de)populated asynchronously based on the Sign In/Out events. So determining the number of bricks attached a glusterfsd process by looking through the same port can go for a toss depending on how fast/slow the events are received/processed by GD2 on the subsequent brick attach/detach requests. Instead if we maintain a list which gets (de)populated when a brick is attached/detached, there's no asynchronous nature in it which is the issue described here. I hope this clarifies the problem statement and why a need for the separate data structure for the bricks per process data. In case it doesn't, please feel free to ask.

@vpandey-RH
Copy link
Contributor

vpandey-RH commented Jan 9, 2019

@atinmu @aravindavk I have one idea which doesn't include adding a whole new data-structure. Instead of just having a mapping of port->brickpath->pid, can we add some sort of current state like pending-delete. So as soon as I send a detach request I can update the port mapper to change the state of brickpath to pending-delete and decrease the number of active bricks on a port(or when calculating IsLastBrickInProc() consider bricks with this state as well), when signOut req comes it can match pending-delete state and delete the brick entry.

@aravindavk
Copy link
Member

@atinmu @aravindavk I have one idea which doesn't include adding a whole new data-structure. Instead of just having a mapping of port->brickpath->pid, can we add some sort of current state like pending-delete. So as soon as I send a detach request I can update the port mapper to change the state of brickpath to pending-delete and decrease the number of active bricks on a port(or when calculating IsLastBrickInProc() consider bricks with this state as well), when signOut req comes it can match pending-delete state and delete the brick entry.

How about removing brickpath from portmap registry, signout coming after this can be safely discarded. Port collision will not happen since glusterd2 is not choosing the port.

@vpandey-RH
Copy link
Contributor

@aravindavk Yes, I totally agree on this. We just need to think if this could have any negative effect in any use case, once we scale up.

@aravindavk
Copy link
Member

only problem I could see is when glusterd2 restarts, this registry is reset. So if a Volume delete comes after the glusterd2 restart and before all bricks signed in, then the check will say that is the last brick and glusterd2 may terminate the process even though other bricks exists in that process.

@vpandey-RH
Copy link
Contributor

That is one issue. Unless we handle signin in GD2 as well.

@atinmu atinmu added bug priority: high GCS/1.0 Issue is blocker for Gluster for Container Storage brick-multiplexing-issue tracker label to capture all issues related to brick multiplexing feature labels Jan 9, 2019
@atinmu atinmu removed the GCS/1.0 Issue is blocker for Gluster for Container Storage label Jan 17, 2019
@atinmu
Copy link
Contributor Author

atinmu commented Jan 17, 2019

Taking this out from GCS/1.0 tag considering we're not going to make brick multiplexing a default option in GCS/1.0 release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
brick-multiplexing-issue tracker label to capture all issues related to brick multiplexing feature bug priority: high
Projects
None yet
Development

No branches or pull requests

3 participants