Repository navigation
Fix SQLMetadataSegmentManager to allow succesive start and stop - #5554
Conversation
| * Resets the LifecycleLock after {@link #exitStop()}, so that {@link #canStart()} could be called again. | ||
| * Finalizes stopping the LifecycleLock and resets it, so that {@link #canStart()} could be called again. If this | ||
| * LifecycleLock is used in a restartable object, this method must be called before exit from stop() on this object, | ||
| * usually in a finally block. |
There was a problem hiding this comment.
The comment after this about IllegalMonitorStateException should refer to canStop() instead of exitStop()
There was a problem hiding this comment.
Thanks. Updated javadoc.
| if (!lifecycleLock.canStart()) { | ||
| throw new ISE("LookupCoordinatorManager can't start."); | ||
| } | ||
| if (!lifecycleLock.canStart()) { |
There was a problem hiding this comment.
Can you update the comment above to show that the synchronization happens on the lock inside DruidCoordinator?
There was a problem hiding this comment.
@jon-wei the above comment makes me realized that the synchronization is really needed to prevent stop() and start() from being called at the same time. LifecycleLcok isn't enough to do that. I reverted LookupCoordinatorManager and added such a synchronization to SQLMetadataSegmentManager.
…he#5554) * Fix SQLMetadataSegmentManager to allow succesive start and stop * address comment * add synchronization
…he#5554) * Fix SQLMetadataSegmentManager to allow succesive start and stop * address comment * add synchronization
… (#5605) * Fix SQLMetadataSegmentManager to allow succesive start and stop * address comment * add synchronization
|
@jihoonson |
…he#5554) * Fix SQLMetadataSegmentManager to allow succesive start and stop * address comment * add synchronization
SQLMetadataSegmentManager throws the below error if a coordinator loses the leadership before start() is called.
I added
exitStopAndReset()method toLifecycleLockinstead ofreset()because calling two methods separately (exitStop()andreset()) isn't done atomically. Also removed unnecessary synchronizations inLookupCoordinatorManager.This change is