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

[Feature] Support write quorum property for table #11253

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

meegoo
Copy link
Contributor

@meegoo meegoo commented Sep 15, 2022

  1. MAJORITY: write majority replica successfully returns success, default option
  2. ONE: write one replica successfully returns success
  3. ALL: write all replica successfully returns success

What type of PR is this:

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

Which issues of this PR fixes :

Fixes #11613

Problem Summary(Required) :

User can set write_quorum to specify replica write strategy when create/alter table.

MAJORITY: write majority replica successfully returns success, default option
ONE: write one replica successfully returns success
ALL: write all replica successfully returns success

Note: The write will only return after all replicas have determined the state, not if the write to some replicas is successful and the state of other replicas is unknown

CREATE TABLE

CREATE TABLE my_table
(
    k1 TINYINT,
    k2 DECIMAL(10, 2) DEFAULT "10.5",
    v1 CHAR(10) REPLACE,
    v2 INT SUM
)
ENGINE = olap
AGGREGATE KEY(k1, k2)
DISTRIBUTED BY HASH(k1) BUCKETS 10
PROPERTIES ("write_quorum" = "one");

ALTER TABLE

ALTER TABLE my_table
SET ("write_quorum" = "ALL");

Checklist:

  • I have added test cases for my bug fix or my new feature
  • I have added user document for my new feature or new function

@meegoo meegoo marked this pull request as draft September 19, 2022 06:44
@meegoo meegoo changed the title [Feature] Support insert quorum config [Feature] Support write quorum properties for table Sep 19, 2022
@meegoo meegoo changed the title [Feature] Support write quorum properties for table [Feature] Support write quorum property for table Sep 19, 2022
@meegoo meegoo force-pushed the insert_quorum branch 4 times, most recently from b987aaa to 74cca3e Compare September 19, 2022 19:08
@meegoo meegoo marked this pull request as ready for review September 19, 2022 19:11
@meegoo meegoo force-pushed the insert_quorum branch 2 times, most recently from 81bedb6 to 781d872 Compare September 19, 2022 20:15
@meegoo
Copy link
Contributor Author

meegoo commented Sep 20, 2022

run starrocks_fe_unittest

@meegoo meegoo force-pushed the insert_quorum branch 3 times, most recently from 6dc9e4f to b776814 Compare September 28, 2022 07:46
@meegoo
Copy link
Contributor Author

meegoo commented Sep 29, 2022

run starrocks_fe_unittest

@meegoo meegoo added the Approved Ready to merge label Oct 8, 2022
@wanpengfei-git
Copy link
Collaborator

run starrocks_admit_test

@meegoo
Copy link
Contributor Author

meegoo commented Oct 8, 2022

run starrocks_fe_unittest

1 similar comment
@meegoo
Copy link
Contributor Author

meegoo commented Oct 9, 2022

run starrocks_fe_unittest

@wanpengfei-git
Copy link
Collaborator

run starrocks_admit_test

@meegoo meegoo enabled auto-merge (squash) October 10, 2022 09:29
gengjun-git
gengjun-git previously approved these changes Oct 10, 2022
@meegoo
Copy link
Contributor Author

meegoo commented Oct 11, 2022

run starrocks_fe_unittest

@wanpengfei-git
Copy link
Collaborator

run starrocks_admit_test

@wanpengfei-git
Copy link
Collaborator

run starrocks_admit_test

1. MAJORITY: write majority replica successfully returns success, default option
2. ONE: write one replica successfully returns success
3. ALL: write all replica successfully returns success
@wanpengfei-git
Copy link
Collaborator

run starrocks_admit_test

@wanpengfei-git
Copy link
Collaborator

[FE PR Coverage Check]

😞 fail : 76 / 116 (65.52%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/persist/EditLog.java 0 2 00.00% [1457, 1458]
🔵 com/starrocks/catalog/ExternalOlapTable.java 0 1 00.00% [330]
🔵 com/starrocks/server/LocalMetastore.java 2 17 11.76% [2099, 2100, 3856, 3857, 3858, 3859, 3860, 3862, 3864, 3866, 3867, 3868, 3869, 3877, 3878]
🔵 com/starrocks/sql/analyzer/AlterTableStatementAnalyzer.java 1 5 20.00% [139, 140, 143, 144]
🔵 com/starrocks/server/GlobalStateMgr.java 1 4 25.00% [2134, 2135, 2136]
🔵 com/starrocks/alter/SchemaChangeHandler.java 5 11 45.45% [1105, 1220, 1221, 1222, 1223, 1224]
🔵 com/starrocks/alter/Alter.java 3 6 50.00% [515, 524, 525]
🔵 com/starrocks/catalog/TableProperty.java 6 8 75.00% [120, 121]
🔵 com/starrocks/common/util/WriteQuorum.java 11 13 84.62% [9, 33]
🔵 com/starrocks/common/util/PropertyAnalyzer.java 6 7 85.71% [464]
🔵 com/starrocks/catalog/OlapTable.java 8 9 88.89% [1646]
🔵 com/starrocks/transaction/OlapTableTxnStateListener.java 1 1 100.00% []
🔵 com/starrocks/planner/StreamLoadPlanner.java 5 5 100.00% []
🔵 com/starrocks/load/loadv2/SparkLoadJob.java 1 1 100.00% []
🔵 com/starrocks/sql/DeletePlanner.java 2 2 100.00% []
🔵 com/starrocks/load/loadv2/LoadingTaskPlanner.java 7 7 100.00% []
🔵 com/starrocks/transaction/TransactionChecker.java 1 1 100.00% []
🔵 com/starrocks/planner/OlapTableSink.java 5 5 100.00% []
🔵 com/starrocks/transaction/DatabaseTransactionMgr.java 1 1 100.00% []
🔵 com/starrocks/sql/UpdatePlanner.java 2 2 100.00% []
🔵 com/starrocks/catalog/PartitionInfo.java 5 5 100.00% []
🔵 com/starrocks/sql/InsertPlanner.java 3 3 100.00% []

@sonarcloud
Copy link

sonarcloud bot commented Oct 11, 2022

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 6 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@meegoo meegoo merged commit 348fc0f into StarRocks:main Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support write quorum property for table
5 participants