Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Make scan metrics not duplicated for tablet internal parallel #33579

Merged

Conversation

ZiheLiu
Copy link
Contributor

@ZiheLiu ZiheLiu commented Oct 24, 2023

When the tablet internal parallel strategy is triggered, the metrics SegmentZoneMapFilterRows and ShortKeyFilterRows in the profile are counted multiple times.

  • For SegmentZoneMapFilterRows
    • only the first split of multiple splits from the same segment contributes to the metric count.
  • For ShortKeyFilterRows
    • For PhysicalSplitMorselQueue, the reason for the duplicate count is that applying the rowid range occurs after applying the short key range. So, moving the application of the rowid range before the application of the short key range will resolve this issue.
    • For LogicalSplitMorselQueue, the reason for the duplicate count is that the number of rows filtered out by the short key range for each split overlaps. For example, for a segment with N rows and a short key range, if it is split into four splits, each with its corresponding sub short key range, they will have $n1$, $n2$, $n3$, and $n4$ rows after applying short key index respectively. The ShortKeyFilterRows counted by the current 4 ChunkSources are $N-n1$, $N-n2$, $N-n3$, and $N-n4$, respectively. Therefore, two modifications are needed:
      • Only the first split ChunkSource's ShortKeyFilterRows is counted as $N-n1$, while the others are counted as $-n2$, $-n3$, and $-n4$, respectively. This ensures that the sum of ShortKeyFilterRows is correct ($N - n1 - n2 - n3 -n4$), but the min and max values are incorrect.
      • Thus, in this case, the min and max values should not be displayed.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@ZiheLiu ZiheLiu force-pushed the opt/main/tablet_internal_parallel_profile branch from d5f985a to 547326e Compare October 25, 2023 07:26
@ZiheLiu ZiheLiu force-pushed the opt/main/tablet_internal_parallel_profile branch from 547326e to 964970f Compare October 25, 2023 08:28
…rallel

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
@ZiheLiu ZiheLiu force-pushed the opt/main/tablet_internal_parallel_profile branch from 643c013 to ad3458d Compare October 25, 2023 09:35
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
satanson
satanson previously approved these changes Oct 25, 2023
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 21 / 21 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/common/util/RuntimeProfile.java 18 18 100.00% []
🔵 com/starrocks/common/util/Counter.java 3 3 100.00% []

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 114 / 125 (91.20%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/connector/lake_connector.cpp 0 3 00.00% [546, 547, 663]
🔵 be/src/storage/rowset/segment_options.cpp 0 1 00.00% [49]
🔵 be/src/storage/rowset/short_key_range_option.h 2 3 66.67% [74]
🔵 be/src/storage/rowset/rowid_range_option.cpp 5 6 83.33% [42]
🔵 be/src/exec/pipeline/scan/olap_chunk_source.cpp 10 11 90.91% [90]
🔵 be/src/exec/pipeline/scan/morsel.cpp 19 21 90.48% [40, 58]
🔵 be/src/storage/rowset/segment_iterator.cpp 33 35 94.29% [741, 742]
🔵 be/src/storage/rowset/rowset.cpp 11 11 100.00% []
🔵 be/src/util/runtime_profile.h 5 5 100.00% []
🔵 be/src/storage/tablet_reader.cpp 3 3 100.00% []
🔵 be/src/util/runtime_profile.cpp 20 20 100.00% []
🔵 be/src/storage/rowset/rowid_range_option.h 1 1 100.00% []
🔵 be/src/storage/rowset/segment.cpp 2 2 100.00% []
🔵 be/src/exec/pipeline/scan/morsel.h 3 3 100.00% []

@satanson satanson merged commit a1bc923 into StarRocks:main Oct 26, 2023
smartlxh pushed a commit to smartlxh/starrocks that referenced this pull request Mar 15, 2024
…rallel (StarRocks#33579)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
wxl24life pushed a commit to wxl24life/starrocks that referenced this pull request Apr 22, 2024
…nternal parallel (StarRocks#33579)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
smartlxh pushed a commit to smartlxh/starrocks that referenced this pull request Oct 16, 2024
…nternal parallel (StarRocks#33579)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
smartlxh pushed a commit to smartlxh/starrocks that referenced this pull request Oct 16, 2024
…nternal parallel (StarRocks#33579)

Signed-off-by: zihe.liu <ziheliu1024@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants