-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[improve](txn insert) make sub transactions visible #41362
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
TeamCity be ut coverage result: |
468f4a1
to
7646c20
Compare
run buildall |
TeamCity be ut coverage result: |
@@ -1743,6 +1745,9 @@ public void setEnableLeftZigZag(boolean enableLeftZigZag) { | |||
@VariableMgr.VarAttr(name = GROUP_COMMIT, needForward = true) | |||
public String groupCommit = "off_mode"; | |||
|
|||
@VariableMgr.VarAttr(name = ENABLE_QUERY_IN_TRANSACTION_LOAD, needForward = true) | |||
public boolean enableQueryInTransactionLoad = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default should be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable_transaction_write_visibility is a better name.
ConnectContext.get().getTxnEntry().getTabletSubTxnIds(olapTable.getId(), tablet)); | ||
LOG.info("table={}, partition={}, tablet={}, sub txn ids={}", olapTable.getId(), partition.getId(), | ||
tablet.getId(), paloRange.getSubTxnIds()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should assure that select in txn is forwarded to master too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the observer also knows the sub txn info
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneEmptyPartition.java
Show resolved
Hide resolved
be/src/olap/tablet.cpp
Outdated
DCHECK(rowset != nullptr) << " rowset is nullptr for sub_txn_id=" << sub_txn_ids[i] | ||
<< ", partition_id=" << partition_id() | ||
<< ", tablet=" << tablet_id(); | ||
int64_t tmp_version = version + i + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version has already been added in prallel_scanner_builder _build_scanners_by_rowid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_load is called firstly, now version is not changed
fe/fe-core/src/main/java/org/apache/doris/transaction/TransactionEntry.java
Show resolved
Hide resolved
58694e1
to
3b07d43
Compare
run buildall |
TeamCity be ut coverage result: |
run buildall |
TeamCity be ut coverage result: |
b730606
to
db8cdc0
Compare
run buildall |
TeamCity be ut coverage result: |
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneEmptyPartition.java
Outdated
Show resolved
Hide resolved
393fb19
to
e4fe448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -128,6 +128,42 @@ BaseTablet::~BaseTablet() { | |||
g_total_tablet_num << -1; | |||
} | |||
|
|||
Status BaseTablet::capture_sub_txn_rs_readers(int64_t version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'capture_sub_txn_rs_readers' can be made const [readability-make-member-function-const]
be/src/olap/base_tablet.cpp:132:
- std::vector<RowSetSplits>* rs_splits) {
+ std::vector<RowSetSplits>* rs_splits) const {
be/src/olap/tablet_reader.cpp
Outdated
// unique keys with merge on write, no need to merge sort keys in rowset | ||
need_ordered_result = false; | ||
if (read_params.query_mow_in_mor) { | ||
need_ordered_result = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant boolean literal in conditional assignment [readability-simplify-boolean-expr]
need_ordered_result = true;
^
@@ -71,7 +71,11 @@ void VCollectIterator::init(TabletReader* reader, bool ori_data_overlapping, boo | |||
(_reader->_direct_mode || _reader->_tablet->keys_type() == KeysType::DUP_KEYS || | |||
(_reader->_tablet->keys_type() == KeysType::UNIQUE_KEYS && | |||
_reader->_tablet->enable_unique_key_merge_on_write()))) { | |||
_merge = false; | |||
if (_reader->_reader_context.query_mow_in_mor) { | |||
_merge = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant boolean literal in conditional assignment [readability-simplify-boolean-expr]
be/src/vec/olap/vcollect_iterator.cpp:73:
- if (_reader->_reader_context.query_mow_in_mor) {
- _merge = true;
- } else {
- _merge = false;
- }
+ _merge = static_cast<bool>(_reader->_reader_context.query_mow_in_mor);
@@ -1410,6 +1410,108 @@ static bool try_fetch_and_parse_schema(Transaction* txn, RowsetMetaCloudPB& rows | |||
return true; | |||
} | |||
|
|||
void MetaServiceImpl::get_tmp_rowset(::google::protobuf::RpcController* controller, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'get_tmp_rowset' exceeds recommended size/complexity thresholds [readability-function-size]
void MetaServiceImpl::get_tmp_rowset(::google::protobuf::RpcController* controller,
^
Additional context
cloud/src/meta-service/meta_service.cpp:1412: 97 lines including whitespace and comments (threshold 80)
void MetaServiceImpl::get_tmp_rowset(::google::protobuf::RpcController* controller,
^
return; | ||
} | ||
// set tablet schema | ||
if (rowset_meta->has_tablet_schema()) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: statement should be inside braces [readability-braces-around-statements]
if (rowset_meta->has_tablet_schema()) continue; | |
if (rowset_meta->has_tablet_schema()) { continue; | |
} |
run buildall |
TeamCity be ut coverage result: |
e4fe448
to
f8e33fe
Compare
run buildall |
run buildall |
TeamCity be ut coverage result: |
run p0 |
26b0fdc
to
ee8e734
Compare
run buildall |
TeamCity be ut coverage result: |
ee8e734
to
21597e2
Compare
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -129,6 +129,42 @@ BaseTablet::~BaseTablet() { | |||
g_total_tablet_num << -1; | |||
} | |||
|
|||
Status BaseTablet::capture_sub_txn_rs_readers(int64_t version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'capture_sub_txn_rs_readers' can be made const [readability-make-member-function-const]
be/src/olap/base_tablet.cpp:133:
- std::vector<RowSetSplits>* rs_splits) {
+ std::vector<RowSetSplits>* rs_splits) const {
TeamCity be ut coverage result: |
21597e2
to
148ee0b
Compare
run buildall |
148ee0b
to
1495454
Compare
run buildall |
1495454
to
548ca97
Compare
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -1418,6 +1418,108 @@ static bool try_fetch_and_parse_schema(Transaction* txn, RowsetMetaCloudPB& rows | |||
return true; | |||
} | |||
|
|||
void MetaServiceImpl::get_tmp_rowset(::google::protobuf::RpcController* controller, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'get_tmp_rowset' exceeds recommended size/complexity thresholds [readability-function-size]
void MetaServiceImpl::get_tmp_rowset(::google::protobuf::RpcController* controller,
^
Additional context
cloud/src/meta-service/meta_service.cpp:1420: 97 lines including whitespace and comments (threshold 80)
void MetaServiceImpl::get_tmp_rowset(::google::protobuf::RpcController* controller,
^
548ca97
to
63ef3c1
Compare
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
this pr does not support mow table.
mow support is in #42089 or #43011