Skip to content

Do not compare finished and all tasks sets eagerly#14635

Merged
sopel39 merged 1 commit intotrinodb:masterfrom
starburstdata:ks/do_not_compare
Oct 17, 2022
Merged

Do not compare finished and all tasks sets eagerly#14635
sopel39 merged 1 commit intotrinodb:masterfrom
starburstdata:ks/do_not_compare

Conversation

@sopel39
Copy link
Copy Markdown
Member

@sopel39 sopel39 commented Oct 14, 2022

No description provided.

private synchronized boolean isStageFinished()
{
return finishedTasks.containsAll(allTasks);
boolean finished = finishedTasks.size() == allTasks.size();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do similar optimization in isStageFlushing ?

Copy link
Copy Markdown
Member

@Dith3r Dith3r Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, if we can have a task id in both sets at some point in time, then we can't make similar optimization there.

@sopel39 sopel39 merged commit ca8e55b into trinodb:master Oct 17, 2022
@sopel39 sopel39 deleted the ks/do_not_compare branch October 17, 2022 13:11
@github-actions github-actions bot added this to the 401 milestone Oct 17, 2022
@colebow
Copy link
Copy Markdown
Member

colebow commented Oct 19, 2022

Does this need a release note?

@sopel39
Copy link
Copy Markdown
Member Author

sopel39 commented Oct 19, 2022

Does this need release notes?

This doesn't need a RN.

adding the no-release-notes label, or just writing "no release notes" in the PR description.

Will do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants