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

[BugFix] fix compatibility issue when collecting query statistics #29678

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

silverbullet233
Copy link
Contributor

@silverbullet233 silverbullet233 commented Aug 22, 2023

this compatibility issue was introduce by #27779

Before #27779, pipeline engine didn't maintain scan statistics for each table, QueryStatistics::_stats_items was always empty, so _stats_items needn't be merged in QueryStatistics::merge.
But after that, QueryStatistics::_stats_items is no longer empty. In the implementation of older version, QueryStatistics::_stats_items is a vector and the problem of deduplication is not considered, which may occupy a lot of memory in QueryStatistics::merge. If a cluster is in the process of grayscale upgrade, the memory usage of the old version BE may increase.

A new session variable enable_collect_table_level_scan_stats is introduced here to control whether to collect table level scan stats, which is false by default, so that the behavior of query stats will remain the same as before during the grayscale upgrade. After all nodes are upgraded, we can set enable_collect_table_level_scan_stats back to true to make fe scan metrics work normally.

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.1
    • 3.0
    • 2.5
    • 2.4

@silverbullet233 silverbullet233 changed the title [BugFox] fix compitable issue in query statistics [BugFix] fix compitable issue in query statistics Aug 22, 2023
@silverbullet233 silverbullet233 changed the title [BugFix] fix compitable issue in query statistics [BugFix] fix compitable issue when collecting query statistics Aug 22, 2023
Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
@silverbullet233 silverbullet233 changed the title [BugFix] fix compitable issue when collecting query statistics [BugFix] fix compatibility issue when collecting query statistics Aug 22, 2023
stdpain
stdpain previously approved these changes Aug 22, 2023
satanson
satanson previously approved these changes Aug 22, 2023
@silverbullet233 silverbullet233 enabled auto-merge (squash) August 22, 2023 08:14
liuyehcf
liuyehcf previously approved these changes Aug 22, 2023
@sevev sevev disabled auto-merge August 22, 2023 09:08
Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
@silverbullet233 silverbullet233 dismissed stale reviews from liuyehcf, satanson, and stdpain via 0b256db August 22, 2023 10:34
@silverbullet233 silverbullet233 enabled auto-merge (squash) August 22, 2023 10:35
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@wanpengfei-git
Copy link
Collaborator

[FE Incremental Coverage Report]

😍 pass : 2 / 2 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/qe/SessionVariable.java 2 2 100.00% []

@wanpengfei-git
Copy link
Collaborator

[BE Incremental Coverage Report]

😍 pass : 11 / 13 (84.62%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 src/exec/pipeline/pipeline_driver.cpp 6 8 75.00% [263, 805]
🔵 src/runtime/runtime_state.h 3 3 100.00% []
🔵 src/exec/pipeline/stream_pipeline_driver.cpp 2 2 100.00% []

@github-actions github-actions bot removed the 2.5 label Aug 22, 2023
@wanpengfei-git
Copy link
Collaborator

@Mergifyio backport branch-2.4

@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

backport branch-3.1

✅ Backports have been created

@github-actions github-actions bot removed the 2.4 label Aug 22, 2023
@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

backport branch-3.0

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

backport branch-2.5

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Aug 22, 2023

backport branch-2.4

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 22, 2023
…9678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
(cherry picked from commit be2f71b)
mergify bot pushed a commit that referenced this pull request Aug 22, 2023
…9678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
(cherry picked from commit be2f71b)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java
#	gensrc/thrift/InternalService.thrift
mergify bot pushed a commit that referenced this pull request Aug 22, 2023
…9678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
(cherry picked from commit be2f71b)

# Conflicts:
#	be/src/exec/pipeline/stream_pipeline_driver.cpp
#	be/src/runtime/runtime_state.h
#	fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java
#	gensrc/thrift/InternalService.thrift
mergify bot pushed a commit that referenced this pull request Aug 22, 2023
…9678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
(cherry picked from commit be2f71b)

# Conflicts:
#	be/src/exec/pipeline/pipeline_driver.cpp
#	be/src/exec/pipeline/stream_pipeline_driver.cpp
#	be/src/runtime/runtime_state.h
#	fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java
#	gensrc/thrift/InternalService.thrift
silverbullet233 added a commit to silverbullet233/starrocks that referenced this pull request Aug 23, 2023
…arRocks#29678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit to silverbullet233/starrocks that referenced this pull request Aug 23, 2023
…arRocks#29678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit to silverbullet233/starrocks that referenced this pull request Aug 23, 2023
…arRocks#29678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit to silverbullet233/starrocks that referenced this pull request Aug 23, 2023
…arRocks#29678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit that referenced this pull request Aug 23, 2023
…9678) (#29739)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit that referenced this pull request Aug 23, 2023
…9678) (#29740)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit that referenced this pull request Aug 23, 2023
…9678) (#29741)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
silverbullet233 added a commit that referenced this pull request Aug 23, 2023
…9678) (#29743)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
wanpengfei-git pushed a commit that referenced this pull request Aug 24, 2023
…9678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
(cherry picked from commit be2f71b)
kangkaisen pushed a commit that referenced this pull request Aug 28, 2023
…9678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
(cherry picked from commit be2f71b)
Jay-ju pushed a commit to Jay-ju/starrocks that referenced this pull request Sep 7, 2023
…arRocks#29678)

Signed-off-by: silverbullet233 <3675229+silverbullet233@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants