HBASE-24792 return value of LogRoller.walRollFinished may be wrong#2169
HBASE-24792 return value of LogRoller.walRollFinished may be wrong#2169WenFeiYi wants to merge 3 commits intoapache:masterfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| } finally { | ||
| this.isRolling = false; | ||
| synchronized (RollController.class) { | ||
| RollController.class.notifyAll(); |
There was a problem hiding this comment.
Usually a dummy notifyAll without any flag in the same synchronized block will have race... Mind explain a bit what is the problem we want to fix here?
There was a problem hiding this comment.
The LogRoller.walRollFinished impl is already buggy. This just checks the status of the boolean. Once we start a roll on a WAL, we reset the boolean (Even before patch HBASE-24665). So it is not clearly telling anything about the roll status. This can return true even while an active wal roll is going on.
We might need another boolean in Controller which clearly tracks whether we are ongoing a roll.
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
Apache9
left a comment
There was a problem hiding this comment.
Please change the title to bette describe what are we trying to fix here? And is it possible to add a UT?
| private final WAL wal; | ||
| private final AtomicBoolean rollRequest; | ||
| private long lastRollTime; | ||
| private boolean isRolling; |
There was a problem hiding this comment.
I think this field will be accessed by multiple threads so a simple boolean it not enough to keep us safe?
|
🎊 +1 overall
This message was automatically generated. |
|
OK, so the problem here is that, walRollFinished returns true but the roll has not been finished yet? Maybe we need to define the exact semantic of this method first... Usually we will call requestRoll first and then call this method? What if there is already a roll in place when we call requestRoll? Thanks. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
No description provided.