Skip to content

Conversation

@kaijchen
Copy link
Member

@kaijchen kaijchen commented Sep 25, 2024

Proposed changes

#41018 used priority queue when selecting memtables to flush.
But the compare function is wrong and causing the order to be the opposite.

Note that the Compare parameter is defined such that it returns true if its first argument comes before its second argument in a weak ordering. But because the priority queue outputs largest elements first, the elements that "come before" are actually output last. That is, the front of the queue contains the "last" element according to the weak ordering imposed by Compare.

This PR fixes the compare function to make larger memtables come front.

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@kaijchen
Copy link
Member Author

run buildall

Copy link
Contributor

@xinyiZzz xinyiZzz left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 25, 2024
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.29% (9625/25808)
Line Coverage: 28.71% (79670/277491)
Region Coverage: 28.13% (41187/146434)
Branch Coverage: 24.76% (20980/84736)
Coverage Report: http://coverage.selectdb-in.cc/coverage/153e852e34059dcbb73d1ddb68cfd179561e94ad_153e852e34059dcbb73d1ddb68cfd179561e94ad/report/index.html

Copy link
Contributor

@liaoxin01 liaoxin01 left a comment

Choose a reason for hiding this comment

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

LGTM

@liaoxin01 liaoxin01 merged commit 519bb39 into apache:master Sep 26, 2024
kaijchen added a commit to kaijchen/doris that referenced this pull request Oct 21, 2024
…he#41278)

## Proposed changes

apache#41018 used priority queue when selecting memtables to flush.
But the compare function is wrong and causing the order to be the
opposite.

> Note that the Compare parameter is defined such that it
returns true if its first argument comes before its second argument in a
weak ordering. But because the priority queue outputs largest elements
first, the elements that "come before" are actually output last. That
is, the front of the queue contains the "last" element according to the
weak ordering imposed by Compare.

This PR fixes the compare function to make larger memtables come front.
kaijchen added a commit to kaijchen/doris that referenced this pull request Nov 18, 2024
…he#41278)

## Proposed changes

apache#41018 used priority queue when selecting memtables to flush.
But the compare function is wrong and causing the order to be the
opposite.

> Note that the Compare parameter is defined such that it
returns true if its first argument comes before its second argument in a
weak ordering. But because the priority queue outputs largest elements
first, the elements that "come before" are actually output last. That
is, the front of the queue contains the "last" element according to the
weak ordering imposed by Compare.

This PR fixes the compare function to make larger memtables come front.
kaijchen added a commit to kaijchen/doris that referenced this pull request Nov 18, 2024
…he#41278)

## Proposed changes

apache#41018 used priority queue when selecting memtables to flush.
But the compare function is wrong and causing the order to be the
opposite.

> Note that the Compare parameter is defined such that it
returns true if its first argument comes before its second argument in a
weak ordering. But because the priority queue outputs largest elements
first, the elements that "come before" are actually output last. That
is, the front of the queue contains the "last" element according to the
weak ordering imposed by Compare.

This PR fixes the compare function to make larger memtables come front.
kaijchen added a commit to kaijchen/doris that referenced this pull request Nov 18, 2024
…he#41278)

## Proposed changes

apache#41018 used priority queue when selecting memtables to flush.
But the compare function is wrong and causing the order to be the
opposite.

> Note that the Compare parameter is defined such that it
returns true if its first argument comes before its second argument in a
weak ordering. But because the priority queue outputs largest elements
first, the elements that "come before" are actually output last. That
is, the front of the queue contains the "last" element according to the
weak ordering imposed by Compare.

This PR fixes the compare function to make larger memtables come front.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants