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 the bug of direct schema change #44854

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

trueeyu
Copy link
Contributor

@trueeyu trueeyu commented Apr 28, 2024

Why I'm doing:

If the segments of single rowset is overlapping, will should use heap merge when do direct schema change, otherwise the rows is not ordered by sort key.

How to reproduce:

 CREATE TABLE `lineorder_1` (
  `lo_orderkey` int(11) NOT NULL COMMENT "",
  `lo_linenumber` int(11) NOT NULL COMMENT "",
  `lo_custkey` int(11) NOT NULL COMMENT "",
  `lo_partkey` int(11) NOT NULL COMMENT "",
  `lo_suppkey` int(11) NOT NULL COMMENT "",
  `lo_orderdate` int(11) NOT NULL COMMENT "",
  `lo_orderpriority` varchar(16) NOT NULL COMMENT "",
  `lo_shippriority` int(11) NOT NULL COMMENT "",
  `lo_quantity` int(11) NOT NULL COMMENT "",
  `lo_extendedprice` int(11) NOT NULL COMMENT "",
  `lo_ordtotalprice` int(11) NOT NULL COMMENT "",
  `lo_discount` int(11) NOT NULL COMMENT "",
  `lo_revenue` int(11) NOT NULL COMMENT "",
  `lo_supplycost` int(11) NOT NULL COMMENT "",
  `lo_tax` int(11) NOT NULL COMMENT "",
  `lo_commitdate` int(11) NOT NULL COMMENT "",
  `lo_shipmode` varchar(11) NOT NULL COMMENT "",
  INDEX t1 (`lo_partkey`) USING BITMAP COMMENT ''
) ENGINE=OLAP 
DUPLICATE KEY(`lo_orderkey`, `lo_linenumber`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`lo_orderkey`) BUCKETS 1 
PROPERTIES (
"compression" = "LZ4",
"fast_schema_evolution" = "true",
"replicated_storage" = "true",
"replication_num" = "1"
);

insert into lineorder_1 select * from lineorder limit 2000000;

select * from lineorder_1 where lo_orderkey>5427812 and lo_orderkey<=5927812;
select lo_orderkey from lineorder_1 where lo_orderkey>5427812 and lo_orderkey<=5927812;
 
The num of return rows is inconsistent.

What I'm doing:

Use heap merge for direct schema change if the segments of rwoset is overlapping.

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
  • This is a backport pr

Bugfix cherry-pick branch check:

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

Signed-off-by: trueeyu <lxhhust350@qq.com>
@trueeyu trueeyu marked this pull request as ready for review April 28, 2024 02:15
@trueeyu trueeyu requested review from a team as code owners April 28, 2024 02:15
@trueeyu trueeyu changed the title [BugfFix] Fix the bug of direct schema change [BugFix] Fix the bug of direct schema change Apr 28, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

pass : 99 / 114 (86.84%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/testutil/schema_test_helper.cpp 35 50 70.00% [18, 20, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 38]
🔵 be/src/storage/schema_change.cpp 9 9 100.00% []
🔵 be/src/testutil/tablet_test_helper.cpp 54 54 100.00% []
🔵 be/src/storage/task/engine_alter_tablet_task.cpp 1 1 100.00% []

@wyb wyb enabled auto-merge (squash) April 29, 2024 02:21
@wyb wyb merged commit 301445d into StarRocks:main Apr 29, 2024
53 checks passed
Copy link

@Mergifyio backport branch-3.3

@github-actions github-actions bot removed the 3.3 label Apr 29, 2024
Copy link

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.2 label Apr 29, 2024
Copy link

@Mergifyio backport branch-3.1

Copy link

@Mergifyio backport branch-3.0

Copy link

@Mergifyio backport branch-2.5

@github-actions github-actions bot removed the 2.5 label Apr 29, 2024
Copy link
Contributor

mergify bot commented Apr 29, 2024

backport branch-3.3

✅ Backports have been created

Copy link
Contributor

mergify bot commented Apr 29, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Apr 29, 2024

backport branch-3.1

✅ Backports have been created

Copy link
Contributor

mergify bot commented Apr 29, 2024

backport branch-3.0

✅ Backports have been created

Copy link
Contributor

mergify bot commented Apr 29, 2024

backport branch-2.5

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 301445d)
mergify bot pushed a commit that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 301445d)
mergify bot pushed a commit that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 301445d)

# Conflicts:
#	be/src/storage/schema_change.cpp
#	be/test/storage/schema_change_test.cpp
#	be/test/storage/tablet_updates_schema_change_test.cpp
mergify bot pushed a commit that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 301445d)

# Conflicts:
#	be/src/storage/schema_change.cpp
#	be/src/storage/task/engine_alter_tablet_task.cpp
#	be/test/storage/schema_change_test.cpp
#	be/test/storage/tablet_updates_schema_change_test.cpp
mergify bot pushed a commit that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 301445d)

# Conflicts:
#	be/src/storage/schema_change.cpp
#	be/src/storage/segment_replicate_executor.h
#	be/src/storage/task/engine_alter_tablet_task.cpp
#	be/src/testutil/CMakeLists.txt
#	be/test/storage/schema_change_test.cpp
#	be/test/storage/tablet_updates_schema_change_test.cpp
node pushed a commit to vivo/starrocks that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request Apr 29, 2024
wanpengfei-git pushed a commit that referenced this pull request Apr 29, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request Apr 30, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request May 1, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request May 7, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.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.

None yet

4 participants