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

ReplacingMergeTree with is_deleted column and clean_deleted_rows=Always works incorrectly #50346

Closed
tavplubix opened this issue May 30, 2023 · 1 comment · Fixed by #57932
Closed
Labels
bug Confirmed user-visible misbehaviour in official release

Comments

@tavplubix
Copy link
Member

dell9510 :) CREATE TABLE test (uid String, version UInt32, is_deleted UInt8) ENGINE = ReplicatedReplacingMergeTree('/test/jhbsavk', '1', version, is_deleted) Order by (uid) settings clean_deleted_rows='Always';

dell9510 :) CREATE TABLE test2 (uid String, version UInt32, is_deleted UInt8) ENGINE = ReplicatedReplacingMergeTree('/test/jhbsavk', '2', version, is_deleted) Order by (uid) settings clean_deleted_rows='Always';

dell9510 :) system stop replicated sends test2

dell9510 :) insert into test values (1, 1, 0)
dell9510 :) insert into test2 values (2, 1, 0)
dell9510 :) insert into test values (1, 2, 0)
dell9510 :) insert into test values (1, 3, 1)

dell9510 :) select *, _part from test

┌─uid─┬─version─┬─is_deleted─┬─_part─────┐
│ 1   │       2 │          0 │ all_2_2_0 │
└─────┴─────────┴────────────┴───────────┘
┌─uid─┬─version─┬─is_deleted─┬─_part─────┐
│ 1   │       3 │          1 │ all_3_3_0 │
└─────┴─────────┴────────────┴───────────┘
┌─uid─┬─version─┬─is_deleted─┬─_part─────┐
│ 1   │       1 │          0 │ all_0_0_0 │
└─────┴─────────┴────────────┴───────────┘

3 rows in set. Elapsed: 0.020 sec. 

dell9510 :) select * from test final

Ok.

0 rows in set. Elapsed: 0.019 sec. 

dell9510 :) optimize table test

Ok.

0 rows in set. Elapsed: 0.035 sec. 

dell9510 :) select * from test final

┌─uid─┬─version─┬─is_deleted─┐
│ 1   │       1 │          0 │
└─────┴─────────┴────────────┘

1 row in set. Elapsed: 0.019 sec. 

dell9510 :) select *, _part from test

┌─uid─┬─version─┬─is_deleted─┬─_part─────┐
│ 1   │       1 │          0 │ all_0_0_0 │
└─────┴─────────┴────────────┴───────────┘

1 row in set. Elapsed: 0.014 sec. 

Related to #41005

@tavplubix tavplubix added the potential bug To be reviewed by developers and confirmed/rejected. label May 30, 2023
@den-crane
Copy link
Contributor

den-crane commented May 30, 2023

related #49685

#49685 (comment)

@tavplubix tavplubix added bug Confirmed user-visible misbehaviour in official release and removed potential bug To be reviewed by developers and confirmed/rejected. labels May 30, 2023
@tavplubix tavplubix reopened this Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants