Do not compare finished and all tasks sets eagerly#14635
Do not compare finished and all tasks sets eagerly#14635sopel39 merged 1 commit intotrinodb:masterfrom
Conversation
| private synchronized boolean isStageFinished() | ||
| { | ||
| return finishedTasks.containsAll(allTasks); | ||
| boolean finished = finishedTasks.size() == allTasks.size(); |
There was a problem hiding this comment.
If we are 100% sure that finishedTasks will not contain any additional tasks which are not included in allTasks this is ok, but I would think of >= comparison here.
There was a problem hiding this comment.
If we are 100% sure that finishedTasks will not contain any additional tasks which are not included in allTasks
That would be a bug
| @@ -395,7 +396,11 @@ private synchronized boolean isStageFlushing() | |||
|
|
|||
| private synchronized boolean isStageFinished() | |||
There was a problem hiding this comment.
Can we do similar optimization in isStageFlushing ?
There was a problem hiding this comment.
isStageFlushing we check two different sets. There is a high chance that flushing size and finished size will be higher than allTask size (first we add to finished, and then we remove from flushing).
There was a problem hiding this comment.
Right, if we can have a task id in both sets at some point in time, then we can't make similar optimization there.
|
Does this need a release note? |
This doesn't need a RN.
Will do! |
No description provided.