Skip to content

Comments

[fix](move-memtable) ensure segment is flushed before add segment#26522

Merged
dataroaring merged 3 commits intoapache:masterfrom
kaijchen:fix-add-segment
Nov 7, 2023
Merged

[fix](move-memtable) ensure segment is flushed before add segment#26522
dataroaring merged 3 commits intoapache:masterfrom
kaijchen:fix-add-segment

Conversation

@kaijchen
Copy link
Member

@kaijchen kaijchen commented Nov 7, 2023

Proposed changes

Currently segment flush is async, and ADD_SEGMENT is handled immediately.
When ADD_SEGMENT arrives, segment flush may not been finished, causing corruption.
Fix this issue by execute ADD_SEGMENT asyncly in the same FIFO threadpool of segment flush.

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@kaijchen
Copy link
Member Author

kaijchen commented Nov 7, 2023

run buildall

dataroaring
dataroaring previously approved these changes Nov 7, 2023
Copy link
Contributor

@dataroaring dataroaring 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 Nov 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2023

PR approved by anyone and no changes requested.

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Nov 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2023

clang-tidy review says "All clean, LGTM! 👍"

@kaijchen
Copy link
Member Author

kaijchen commented Nov 7, 2023

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

}

Status LoadStreamWriter::add_segment(uint32_t segid, SegmentStatistics& stat) {
Status LoadStreamWriter::add_segment(uint32_t segid, const SegmentStatistics& stat) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: method 'add_segment' can be made static [readability-convert-member-functions-to-static]

be/src/runtime/load_stream_writer.h:73:

-     Status add_segment(uint32_t segid, const SegmentStatistics& stat);
+     static Status add_segment(uint32_t segid, const SegmentStatistics& stat);

dataroaring
dataroaring previously approved these changes Nov 7, 2023
Copy link
Contributor

@dataroaring dataroaring 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 Nov 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2023

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

Copy link
Contributor

@sollhui sollhui left a comment

Choose a reason for hiding this comment

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

LGTM

@kaijchen
Copy link
Member Author

kaijchen commented Nov 7, 2023

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Nov 7, 2023
@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.02% (8391/22669)
Line Coverage: 29.43% (67924/230770)
Region Coverage: 28.12% (35149/124986)
Branch Coverage: 24.90% (17960/72118)
Coverage Report: http://coverage.selectdb-in.cc/coverage/de12062de25d0389d8d5e8e38d651e19121355e5_de12062de25d0389d8d5e8e38d651e19121355e5/report/index.html

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.65 seconds
stream load tsv: 556 seconds loaded 74807831229 Bytes, about 128 MB/s
stream load json: 21 seconds loaded 2358488459 Bytes, about 107 MB/s
stream load orc: 65 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
insert into select: 28.8 seconds inserted 10000000 Rows, about 347K ops/s
storage size: 17161945798 Bytes

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

@dataroaring dataroaring merged commit 4995ca8 into apache:master Nov 7, 2023
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2023

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

@kaijchen kaijchen deleted the fix-add-segment branch November 7, 2023 16:03
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. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants