Skip to content

[fix](binlog) Track committed TSO and fence uncertain commits for bounded incremental reads - #67820

Merged
luwei16 merged 18 commits into
apache:masterfrom
luwei16:fix/doris-28434-committed-tso-watermark
Sep 18, 2026
Merged

luwei16 merged 18 commits into
apache:masterfrom
luwei16:fix/doris-28434-committed-tso-watermark

Conversation

@luwei16

@luwei16 luwei16 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: #67181, #67594

Problem Summary:

Bounded cloud @incr reads need a safe end timestamp. Waiting by transaction ID can include transactions outside the requested time window, while one slow transaction can hold a global committed prefix and block unrelated tables. FE failover also needs to prevent an old master or an uncertain commit RPC from later committing a TSO that FE has already treated as finished.

This PR introduces a durable committed TSO and keeps the active commit-attempt set in the FE master:

  • Allocate and register a commit TSO immediately before the first Meta Service commit RPC, under the TSO allocator lock. Retries after a fenced response replace the registration with a fresh TSO above the returned fence.
  • On an explicit success, already-visible result or already-aborted result, remove the transaction registration. On another explicit failure, remove only the exact attempted TSO.
  • On KV_TXN_MAYBE_COMMITTED, an RPC timeout, connection loss or another uncertain result, synchronously advance the per-instance Meta Service fence to the attempted TSO before removing it. If fencing fails, deactivate the TSO service so reads and allocations cannot use an unsafe prefix.
  • Disable transport-level retries for commits carrying a positive TSO. MS_TOO_BUSY remains retryable because Meta Service explicitly rejects it before processing. Non-TSO transactions keep the existing retry behavior.
  • Derive the committed TSO from the current allocated TSO and the oldest registered attempt, and persist it together with the allocation-window end in one BDB journal record. The default persistence window is reduced from five seconds to one second.
  • Remove the startup transaction scan, recovery RPC, recovery state, and periodic checkTransactions(). A new master persists a fresh window and advances the same global fence before enabling TSO service, so commits using an older TSO are rejected without waiting for PREPARED transactions.
  • A successful lazy commit can be released from FE memory. Incremental scans ask Meta Service to wait for pending transactions on the selected partitions before fixing their visible versions, preserving readability without a global recovery list.

For a strongly consistent cloud read with an explicit end on every incremental relation, FE applies these rules:

Requested end Behavior
After the current TSO physical time Return 5100 / ERR_INCR_WINDOW_NOT_READY immediately.
At or before the durable committed TSO physical time Admit the window directly.
Between committed and current TSO physical times Wait only for the captured FE registrations whose TSO is within the window and whose tables are queried. Return 5101 / ERR_INCR_VISIBLE_WAIT_TIMEOUT when the wait expires.

After admission, version resolution waits only for pending transactions on the selected partitions. Unrelated tables do not participate in either wait.

information_schema.tso_status exposes COMMITTED_TSO and COMMITTED_TSO_PHYSICAL_TIME; the latter is epoch milliseconds and is the maximum globally admitted end timestamp. The existing current TSO and allocation-window columns remain available.

The Meta Service fence is one monotonic, non-versioned current-state key in the instance transaction namespace. Commit reads it in the same FDB transaction as the metadata commit and rejects commit_tso <= fence with TXN_COMMIT_TSO_EXPIRED, returning the effective fence. The check runs only when both the FE request flag and the mutable Meta Service configuration are enabled. Cloud snapshot, clone and rollback do not restore this leadership/commit fence; a restored or cloned instance publishes its current fence when its FE master initializes.

Upgrade Meta Service before FE. A missing or unavailable fence RPC keeps a new FE TSO service uninitialized. The new Meta Service error code uses actual_code while old clients receive the compatible fallback code.

Connector error handling

Code Name Meaning Connector action
5100 ERR_INCR_WINDOW_NOT_READY The requested end is after current TSO, or the FE master/TSO generation changed while establishing the window. Retry the same end timestamp after retryAfterMs; do not advance the incremental offset. Route a retry through the current master when the reason is TSO_MASTER_CHANGED.
5101 ERR_INCR_VISIBLE_WAIT_TIMEOUT Relevant commit attempts did not finish within change_visible_timeout_ms. Retry the same end timestamp; do not advance the incremental offset.

MySQL returns SQLSTATE HY000; the message contains reason, requested end, current TSO, committed TSO, their physical times, timeout and retry delay. Arrow Flight SQL returns UNAVAILABLE only for these two errors and includes doris-error-code and doris-error-name metadata. Other Flight failures retain the original INTERNAL wrapping.

Release note

Improve bounded, strongly consistent cloud incremental reads with a durable committed TSO, table-scoped waits and per-instance commit TSO fencing. Expose the committed TSO through information_schema.tso_status, distinguish an unavailable window (5100) from a visibility wait timeout (5101), and remove FE startup/periodic transaction recovery scans. Upgrade Meta Service before FE.

Check List (For Author)

  • Test
    • FE unit tests for TSO service/tracker, commit-result handling, Meta Service retry behavior, incremental version waits, MySQL error propagation and Arrow Flight SQL error mapping.
    • Cloud ASAN unit tests for fence monotonicity and stale-commit rejection, fence-key encoding, and response-code compatibility.
    • Regression tests test_committed_tso and test_binlog_changes_syntax passed earlier in this PR with outputs generated by the standard runner.
    • ./build.sh -j32 and ./build.sh --cloud -j32.
    • clang-format 16, check-format, Cloud clang-tidy and build-hygiene checks.
  • Behavior changed: Yes. Bounded cloud reads use committed TSO/table-scoped waits; uncertain TSO commit attempts are fenced before release; FE no longer scans transactions during startup or periodically.
  • Does this need documentation: Yes. Connector-facing error handling is documented above.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: None

Related PR: apache#67181, apache#67594

Problem Summary: Strongly consistent cloud incremental reads drain earlier
transactions even when those transactions fall outside the requested historical
window. A delayed write can therefore block an otherwise readable window.
Track commit TSO allocations and unfinished transactions under the allocator
lock, and publish a readable prefix together with the reserved TSO window only
after their journal write succeeds. Accepted bounded windows skip transaction
watermark/conflict polling and retain the MetaService visible-version refresh.

Allocate commit TSO after bitmap preparation, callbacks and metadata validation.
Preserve the earliest registration across submission retries and release it
only after real VISIBLE/ABORTED, including lazy-commit reconciliation. On master
recovery, retain the durable prefix until a fixed, instance-wide transaction
bound passes a strict MetaService check after the configured recovery delay.
The fixed wait retains the agreed old-master fencing limitation.

### Release note

In cloud mode, strongly consistent incremental queries with an explicit end on
every incremental relation use committed TSO. Unready windows return MySQL error
5100 (ERR_INCR_WINDOW_NOT_READY), or Flight UNAVAILABLE with business metadata;
clients should retry the same window. information_schema.tso_status exposes
COMMITTED_TSO and COMMITTED_TSO_PHYSICAL_TIME. The TSO persistence window defaults
to one second. Upgrade MetaService before enabling prefix recovery on new FEs.

### Check List (For Author)

- Test: Unit Test / Regression test / Manual test
    - 79 distinct focused FE tests, 9 BE scanner tests and 3 MetaService tests passed.
    - test_committed_tso and test_binlog_changes_syntax passed; new output generated by the standard regression runner.
    - Real master/follower MySQL and Flight statement/prepared error contracts passed.
    - Three-FE failover with an allocated, PREPARED transaction preserved the old prefix and historical reads; confirmed abort released recovery and advanced the prefix.
    - FE build and Checkstyle, ASAN BE/Cloud builds, clang-format 16 and build hygiene passed. clang-tidy reported no changed-line diagnostics with a matching-toolchain wrapper and an analysis-only overlay for an existing unmatched suppression comment; five unchanged scanner diagnostics remain.
    - No throughput or latency benchmark was run.
- Behavior changed: Yes (bounded cloud read admission, visible-prefix system columns, later commit TSO allocation and one-second persistence)
- Does this need documentation: Yes (included docs/committed-tso.md)
### What problem does this PR solve?

Issue Number: None

Related PR: apache#67181, apache#67594

Problem Summary: The committed-TSO window check made getFlightInfoStatement pass through every FlightRuntimeException. Other Flight failures therefore lost the original INTERNAL wrapper, message prefix and cause chain, and unrelated status codes could reach clients unchanged. Only pass through an exception carrying the ERR_INCR_WINDOW_NOT_READY business code; retain the original wrapping for all other exceptions.

### Release note

Preserve the existing Arrow Flight SQL error wrapping for failures other than ERR_INCR_WINDOW_NOT_READY. Window-not-ready errors still expose the retryable status and committed TSO details.

### Check List (For Author)

- Test: Unit Test (all 7 DorisFlightSqlProducerTest tests passed via run-fe-ut.sh; the new cases reproduce the previous wrapping failures); FE Checkstyle passed with 0 violations
- Behavior changed: Yes (restore the original INTERNAL wrapper for other Flight errors)
- Does this need documentation: No (restore existing error handling)
…l reads

### What problem does this PR solve?

Issue Number: None

Related PR: apache#67181, apache#67594

Problem Summary: A slow commit on one table holds the global committed TSO and rejects otherwise complete incremental windows on unrelated tables. Keep the durable-prefix fast path, reject ends after the current TSO immediately, and let intermediate windows wait for a fixed snapshot of registered transactions involving their tables. Capture the snapshot under the allocator lock and release that lock during the wait; real terminal notifications and reconciliation wake readers without another journal flush. Preserve the recovery guard and distinguish future/recovering windows from visibility wait timeouts through follower RPC, MySQL and Arrow Flight SQL.

### Release note

Bounded strongly consistent cloud incremental reads can proceed above the durable committed TSO when their relevant transactions are finished. Visibility wait timeouts return error 5101 (ERR_INCR_VISIBLE_WAIT_TIMEOUT); future or recovering windows retain error 5100 (ERR_INCR_WINDOW_NOT_READY). Both include the current and committed TSO and retry details.

### Check List (For Author)

- Test: 65 distinct focused FE unit tests; full FE build and Checkstyle; test_committed_tso SQL regression generated and verified; live MySQL and Flight statement/prepared checks on one master and two followers, including transaction visibility wakeup.
- Behavior changed: Yes (table-scoped waiting above the durable prefix and distinct visibility-timeout error).
- Does this need documentation: Yes (docs/committed-tso.md updated).
### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Remove docs/committed-tso.md from the change as requested. The implementation and tests are unchanged.

### Release note

None

### Check List (For Author)

- Test: No need to test (documentation deletion only); git diff --check passed.
- Behavior changed: No
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@luwei16 luwei16 changed the title [fix](cloud) Gate bounded incremental reads with committed TSO [fix](cloud) Use committed TSO and per-table transaction waits for bounded incremental reads Sep 10, 2026
@luwei16

luwei16 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 100.00% (28/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.53% (2056/2652)
Line Coverage 65.77% (37641/57232)
Region Coverage 53.08% (35146/66209)
Branch Coverage 56.48% (11284/19978)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 87.08% (364/418) 🎉
Increment coverage report
Complete coverage report

### What problem does this PR solve?

Issue Number: None

Related PR: apache#67820

Problem Summary: The committed TSO change adds two columns to information_schema.tso_status, but SchemaTableTest still expects four columns and fails FE unit CI. Expect all six columns and verify the names and positions of the two new columns while retaining the original column checks.

### Release note

None

### Check List (For Author)

- Test: Unit Test; reproduced the original SchemaTableTest failure, then passed all 7 SchemaTableTest and TsoStatusMetadataGeneratorTest cases with run-fe-ut.sh. FE Checkstyle and git diff --check passed.
- Behavior changed: No
- Does this need documentation: No
@luwei16

luwei16 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 87.08% (364/418) 🎉
Increment coverage report
Complete coverage report

@luwei16

luwei16 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

run cloudut

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 100.00% (28/28) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.53% (2056/2652)
Line Coverage 65.75% (37630/57232)
Region Coverage 53.00% (35093/66209)
Branch Coverage 56.44% (11275/19978)

@luwei16 luwei16 changed the title [fix](cloud) Use committed TSO and per-table transaction waits for bounded incremental reads [fix](binlog) Use committed TSO and per-table transaction waits for bounded incremental reads Sep 11, 2026
### What problem does this PR solve?

Issue Number: None

Related PR: apache#67820

Problem Summary: After FE failover, one unfinished old transaction blocks every
bounded incremental read above the durable committed TSO, including reads of
unrelated tables. Reuse check_txn_conflict to fetch old running transactions
in bounded batches after capturing the fixed recovery transaction-ID bound.
Once the complete list is loaded, wait only for related tables and known TSO
boundaries. Retain unknown-TSO transactions for their tables and keep the global
committed TSO frozen until all recovered transactions are VISIBLE or ABORTED.
Preserve concurrent registrations and resume failed scans from the last
successful batch without opening an incomplete recovery.

### Release note

After cloud FE failover, unrelated tables can read bounded incremental windows
once the old transaction list is loaded, while relevant transactions still
wait with the existing visibility timeout. Upgrade MetaService before FE to
support fetching recovery transactions in batches.

### Check List (For Author)

- Test: 86 focused FE unit tests; 6 ASAN MetaService/recovery/lazy-commit tests;
    test_committed_tso regression; three-FE failover and original-window retry;
    FE/MS product builds, FE Checkstyle, clang-format 16 and Cloud clang-tidy.
- Behavior changed: Yes, enable table-scoped waits while old recovery transactions remain pending.
- Does this need documentation: No
@luwei16

luwei16 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

### What problem does this PR solve?

Issue Number: None

Related PR: apache#67820

Problem Summary: TSO recovery had added strict-check and batch modes to the
existing transaction-conflict RPC, mixing recovery scans with table-scoped
conflict checks. Add get_tso_recovery_transactions with its own request,
response, client wrappers, handler and metrics. Restore check_txn_conflict
and its messages to their original definitions. Preserve fixed-bound batch
scanning, table-scoped waits and committed-TSO advancement. An unavailable
new RPC or incomplete batch keeps recovery closed without falling back to
the old conflict check.

### Release note

Upgrade MetaService before FE to provide the dedicated TSO recovery RPC.
Incremental-query waiting behavior and error codes remain unchanged.

### Check List (For Author)

- Test: 108 FE unit tests; 9 ASAN MetaService/recovery/legacy-conflict/lazy-commit
    tests; test_committed_tso regression; live old/new RPC and three-FE failover
    verification; FE/MS product builds, FE Checkstyle, clang-format 16 and Cloud clang-tidy.
- Behavior changed: Yes, the internal recovery RPC changes; SQL behavior is unchanged.
- Does this need documentation: No
@luwei16

luwei16 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

morningman pushed a commit that referenced this pull request Sep 11, 2026
…ounded incremental reads (#67861)

### What problem does this PR solve?

Issue Number: None

Related PR: #67820

Problem Summary: Backport the complete seven-commit change from PR
#67820 through 1727203 onto
branch-incremental-computation. A slow commit can otherwise block
bounded incremental reads of unrelated tables. Preserve the
committed-TSO fast path, table-scoped waits, separate future-window and
visibility-timeout errors, and recovery through the dedicated
get_tso_recovery_transactions RPC. Keep the target branch's existing TSO
range validation and exclude the deleted design document. The change
applies without conflicts. Add a documented, targeted function-size
suppression to keep the bounded recovery scan and its KV snapshot/error
lifetime together without behavioral refactoring. Also suppress
macro-expanded cognitive complexity for the cohesive two-batch recovery
test.

### Release note

Bounded strongly consistent cloud incremental reads use the durable
committed TSO or wait only for related transactions.
information_schema.tso_status exposes the committed TSO. Errors 5100 and
5101 distinguish unavailable windows from visibility wait timeouts.
Upgrade MetaService before FE for the recovery RPC.

### Check List (For Author)

- Test: 163 focused FE unit tests, 9 ASAN MetaService
recovery/legacy-conflict/ lazy-commit tests, and 9 ASAN BE scanner tests
passed. FE/BE/MS product builds, FE Checkstyle, C++ formatting and build
hygiene passed. C++ changed-line static analysis passed with a toolchain
wrapper and an analysis-only overlay for an existing unmatched
suppression. Raw diagnostics were independently checked to avoid the
script's large-output filtering issue. No live regression or new remote
CI run was performed for this backport.
- Behavior changed: Yes (backport committed-TSO admission and
table-scoped waits).
- Does this need documentation: No (backport existing PR; design
document excluded).
@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author
schema: doris-repo-review/v1
status: PASS
pr: apache/doris#67820
commit: 29f133584b5372d97632de85c0ba19a0c5abac18
base: c4dee4bd5e82c6f0f380e0243cbaf265999e6a6a
reviewed_at: 2026-09-17T12:58:42+08:00
reviewer: luwei16
model: gpt-6-astra
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 2
converged: true

@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 27932 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 29f133584b5372d97632de85c0ba19a0c5abac18, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17661	3866	3867	3866
q2	2260	351	306	306
q3	10018	1404	780	780
q4	4685	479	352	352
q5	7474	816	554	554
q6	175	166	135	135
q7	733	794	584	584
q8	9328	1497	1467	1467
q9	5553	4243	4226	4226
q10	6761	1677	1356	1356
q11	460	269	261	261
q12	628	422	309	309
q13	18070	2637	2042	2042
q14	270	257	240	240
q15	q16	731	726	660	660
q17	1699	1072	980	980
q18	6538	5626	5602	5602
q19	1185	1268	1094	1094
q20	485	396	264	264
q21	5447	2942	2551	2551
q22	457	378	303	303
Total cold run time: 100618 ms
Total hot run time: 27932 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4696	4730	4526	4526
q2	796	616	572	572
q3	4885	5263	4710	4710
q4	2250	2329	1511	1511
q5	4603	4441	4639	4441
q6	235	180	129	129
q7	1827	1761	1486	1486
q8	2314	2125	2043	2043
q9	7331	7251	7234	7234
q10	4435	4275	3864	3864
q11	515	370	345	345
q12	700	713	501	501
q13	2308	2646	2028	2028
q14	259	275	246	246
q15	q16	667	678	643	643
q17	7378	6713	6659	6659
q18	11895	11055	11778	11055
q19	1096	1011	969	969
q20	2224	2182	1923	1923
q21	5350	4437	4588	4437
q22	530	459	418	418
Total cold run time: 66294 ms
Total hot run time: 59740 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 154155 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 29f133584b5372d97632de85c0ba19a0c5abac18, data reload: false

query5	4353	595	449	449
query6	436	186	169	169
query7	4846	548	280	280
query8	334	174	167	167
query9	8810	3998	3953	3953
query10	482	315	278	278
query11	5812	2223	2029	2029
query12	153	97	94	94
query13	1249	575	404	404
query14	6561	4582	4249	4249
query14_1	4024	4004	3979	3979
query15	204	197	185	185
query16	998	454	409	409
query17	917	673	539	539
query18	2419	448	335	335
query19	197	182	140	140
query20	103	103	105	103
query21	217	138	117	117
query22	13166	12995	12948	12948
query23	15491	14612	14178	14178
query23_1	14318	14215	14291	14215
query24	7595	1691	1208	1208
query24_1	1253	1231	1231	1231
query25	556	434	363	363
query26	1255	329	170	170
query27	2700	543	327	327
query28	4594	1974	1990	1974
query29	1061	588	480	480
query30	327	245	215	215
query31	894	766	634	634
query32	144	97	93	93
query33	525	343	248	248
query34	1232	1148	642	642
query35	726	759	677	677
query36	804	782	747	747
query37	153	107	92	92
query38	1843	1880	1704	1704
query39	724	669	682	669
query39_1	653	655	664	655
query40	224	123	103	103
query41	72	71	73	71
query42	96	93	93	93
query43	337	353	299	299
query44	1377	693	703	693
query45	192	181	177	177
query46	1113	1138	716	716
query47	1490	1509	1412	1412
query48	408	402	297	297
query49	586	458	287	287
query50	962	330	236	236
query51	10730	10422	10443	10422
query52	90	89	73	73
query53	247	258	176	176
query54	246	205	180	180
query55	76	71	72	71
query56	225	219	197	197
query57	1484	1506	1359	1359
query58	235	207	214	207
query59	1980	2048	1820	1820
query60	311	237	199	199
query61	139	141	132	132
query62	400	319	271	271
query63	221	176	178	176
query64	2823	1020	824	824
query65	4050	3978	3960	3960
query66	1788	420	310	310
query67	20189	20229	19738	19738
query68	3387	1475	946	946
query69	400	296	263	263
query70	970	904	870	870
query71	293	229	210	210
query72	2844	2511	2157	2157
query73	830	734	427	427
query74	4672	4507	4314	4314
query75	2307	2293	1925	1925
query76	2351	1106	734	734
query77	365	386	307	307
query78	9390	9092	8579	8579
query79	1378	1152	724	724
query80	1250	457	388	388
query81	530	285	237	237
query82	633	161	129	129
query83	356	273	251	251
query84	306	142	111	111
query85	870	449	364	364
query86	412	239	225	225
query87	1983	1953	1832	1832
query88	3608	2709	2664	2664
query89	367	287	243	243
query90	1958	175	176	175
query91	167	159	123	123
query92	92	89	87	87
query93	1459	1477	853	853
query94	731	329	293	293
query95	661	463	335	335
query96	1076	821	310	310
query97	2441	2432	2355	2355
query98	205	188	188	188
query99	742	713	622	622
Total cold run time: 243463 ms
Total hot run time: 154155 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 23.91 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 29f133584b5372d97632de85c0ba19a0c5abac18, data reload: false

query1	0.01	0.01	0.00
query2	0.10	0.05	0.05
query3	0.26	0.14	0.13
query4	1.61	0.14	0.14
query5	0.25	0.22	0.21
query6	1.16	0.90	0.94
query7	0.04	0.01	0.01
query8	0.06	0.04	0.03
query9	0.38	0.33	0.34
query10	0.55	0.58	0.55
query11	0.21	0.14	0.14
query12	0.18	0.14	0.16
query13	0.47	0.47	0.47
query14	0.95	0.94	0.95
query15	0.61	0.59	0.59
query16	0.31	0.32	0.33
query17	1.04	1.11	1.04
query18	0.21	0.20	0.20
query19	2.03	1.87	1.92
query20	0.02	0.01	0.02
query21	15.46	0.22	0.14
query22	4.75	0.05	0.05
query23	16.14	0.31	0.13
query24	2.92	0.44	0.33
query25	0.12	0.06	0.03
query26	0.72	0.20	0.15
query27	0.03	0.04	0.03
query28	3.54	0.81	0.38
query29	12.48	4.06	3.21
query30	0.27	0.14	0.16
query31	2.78	0.57	0.31
query32	3.22	0.59	0.50
query33	3.21	3.21	3.17
query34	15.79	4.01	3.26
query35	3.23	3.24	3.23
query36	0.56	0.42	0.44
query37	0.10	0.07	0.07
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.15	0.14
query41	0.08	0.04	0.03
query42	0.04	0.03	0.02
query43	0.05	0.03	0.03
Total cold run time: 96.21 s
Total hot run time: 23.91 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 85.47% (394/461) 🎉
Increment coverage report
Complete coverage report

@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

run p0

@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

run cloud_p0

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 69.82% (31479/45088)
Line Coverage 54.55% (344330/631188)
Region Coverage 51.09% (288504/564692)
Branch Coverage 51.75% (131309/253751)

### What problem does this PR solve?

Issue Number: None

Related PR: apache#67181, apache#67594

Problem Summary: A Meta Service KV_TXN_MAYBE_COMMITTED response means the underlying commit attempt is no longer in flight: it either committed or will never commit. Advancing the TSO fence before releasing this TSO adds an unnecessary Meta Service write. Release the tracked TSO directly for this response while retaining fence advancement for FE-to-Meta-Service RPC failures whose requests may still complete later.

### Release note

None

### Check List (For Author)

- Test: Unit Test
    - CloudCommittedTsoTest: 3 passed
    - Full `./build.sh -j32`: passed
- Behavior changed: Yes. KV_TXN_MAYBE_COMMITTED releases its tracked TSO without advancing the fence.
- Does this need documentation: No
@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 57.39% (66/115) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.54% (2064/2662)
Line Coverage 65.74% (37924/57684)
Region Coverage 53.25% (35580/66813)
Branch Coverage 56.53% (11413/20188)

@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Review conclusion: PASS for fc4f996920282b095a09313ba2eac18d32ab00a4.

No Blocker or Major findings remain after two review rounds. The earlier concerns about KV_TXN_MAYBE_COMMITTED, using the maximum end TSO across queried tables, and waiting selected ordinary-scan partitions were rechecked and are conservative/safe behaviors rather than correctness blockers.

One non-blocking Minor remains: the final Meta Service lazy-commit wait follows the version-RPC timeout rather than strictly sharing change_visible_timeout_ms, and eventual mode may still wait at this stage. This can increase latency for a slow lazy commit but does not cause incorrect results; it can be handled separately.

schema: doris-repo-review/v1
status: PASS
pr: apache/doris#67820
commit: fc4f996920282b095a09313ba2eac18d32ab00a4
base: c4dee4bd5e82c6f0f380e0243cbaf265999e6a6a
reviewed_at: 2026-09-17T19:12:19+08:00
reviewer: luwei16
model: gpt-5.6-sol
effort: xhigh
findings: {blocker: 0, major: 0, minor: 1, nit: 0}
rounds: 2
converged: true

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.28% (34392/45089)
Line Coverage 61.20% (386274/631189)
Region Coverage 57.65% (325542/564693)
Branch Coverage 58.36% (148092/253747)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 27862 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit fc4f996920282b095a09313ba2eac18d32ab00a4, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17735	4097	3980	3980
q2	2292	350	293	293
q3	10026	1473	799	799
q4	4688	488	349	349
q5	7482	840	549	549
q6	192	179	140	140
q7	780	805	598	598
q8	9324	1768	1605	1605
q9	5513	4250	4245	4245
q10	6738	1627	1374	1374
q11	432	285	246	246
q12	630	452	313	313
q13	18041	2687	1992	1992
q14	261	259	240	240
q15	q16	727	719	678	678
q17	1810	1177	1024	1024
q18	6552	5679	5587	5587
q19	1199	1244	1050	1050
q20	482	416	269	269
q21	5510	2586	2226	2226
q22	430	360	305	305
Total cold run time: 100844 ms
Total hot run time: 27862 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4343	4200	4185	4185
q2	805	613	627	613
q3	4605	4994	4359	4359
q4	2289	2408	1478	1478
q5	4333	4225	4233	4225
q6	234	180	126	126
q7	1771	1594	1492	1492
q8	3030	2361	2293	2293
q9	7785	7680	7903	7680
q10	4358	4311	3928	3928
q11	613	402	376	376
q12	772	765	517	517
q13	2559	2848	2186	2186
q14	295	304	277	277
q15	q16	708	763	665	665
q17	8056	7378	7333	7333
q18	12023	11234	11901	11234
q19	1217	1066	1057	1057
q20	2286	2298	1975	1975
q21	5983	4940	5057	4940
q22	539	443	409	409
Total cold run time: 68604 ms
Total hot run time: 61348 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 153490 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit fc4f996920282b095a09313ba2eac18d32ab00a4, data reload: false

query5	4313	600	465	465
query6	438	187	164	164
query7	4825	576	277	277
query8	315	177	161	161
query9	8768	3977	4000	3977
query10	460	301	256	256
query11	5738	2237	2040	2040
query12	155	95	95	95
query13	1241	555	388	388
query14	6580	4547	4246	4246
query14_1	4028	4035	4042	4035
query15	208	198	180	180
query16	984	454	424	424
query17	929	668	527	527
query18	2436	453	333	333
query19	204	185	140	140
query20	105	103	101	101
query21	225	135	118	118
query22	13186	13107	12858	12858
query23	15476	14585	14061	14061
query23_1	14068	13928	14095	13928
query24	7593	1721	1214	1214
query24_1	1247	1208	1251	1208
query25	571	460	400	400
query26	1270	305	168	168
query27	2705	535	346	346
query28	4617	1962	1928	1928
query29	1042	607	476	476
query30	318	237	201	201
query31	890	760	637	637
query32	146	101	98	98
query33	519	320	262	262
query34	1233	1094	626	626
query35	717	785	645	645
query36	799	789	697	697
query37	167	106	90	90
query38	1844	1756	1712	1712
query39	682	680	646	646
query39_1	662	637	663	637
query40	237	120	104	104
query41	71	70	69	69
query42	98	94	92	92
query43	339	347	299	299
query44	1352	696	691	691
query45	191	180	171	171
query46	1007	1173	734	734
query47	1511	1492	1394	1394
query48	406	387	305	305
query49	602	403	298	298
query50	1019	339	241	241
query51	10721	10535	10211	10211
query52	84	83	73	73
query53	233	254	185	185
query54	266	200	182	182
query55	75	74	69	69
query56	222	211	223	211
query57	1508	1341	1398	1341
query58	230	212	200	200
query59	1957	2069	1809	1809
query60	277	221	215	215
query61	142	142	139	139
query62	408	317	267	267
query63	210	172	168	168
query64	2892	999	845	845
query65	4016	3975	3940	3940
query66	1846	418	304	304
query67	20722	20158	20024	20024
query68	3394	1497	862	862
query69	430	308	251	251
query70	953	885	864	864
query71	294	230	207	207
query72	2868	2497	2123	2123
query73	825	813	426	426
query74	4624	4504	4270	4270
query75	2275	2260	1924	1924
query76	2394	1109	710	710
query77	363	404	288	288
query78	9222	9107	8608	8608
query79	1300	1167	732	732
query80	579	449	352	352
query81	473	281	236	236
query82	622	155	121	121
query83	353	275	245	245
query84	316	152	110	110
query85	832	454	379	379
query86	326	244	233	233
query87	2006	1977	1815	1815
query88	3612	2725	2703	2703
query89	346	281	248	248
query90	1950	182	179	179
query91	167	149	126	126
query92	104	90	84	84
query93	1563	1457	876	876
query94	543	350	309	309
query95	687	447	333	333
query96	1048	758	358	358
query97	2463	2430	2336	2336
query98	196	190	183	183
query99	748	738	607	607
Total cold run time: 242257 ms
Total hot run time: 153490 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 23.99 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit fc4f996920282b095a09313ba2eac18d32ab00a4, data reload: false

query1	0.01	0.00	0.01
query2	0.10	0.05	0.05
query3	0.27	0.14	0.13
query4	1.62	0.13	0.14
query5	0.25	0.23	0.23
query6	1.16	1.00	0.94
query7	0.05	0.01	0.01
query8	0.06	0.04	0.03
query9	0.39	0.33	0.36
query10	0.57	0.55	0.55
query11	0.22	0.15	0.14
query12	0.19	0.15	0.15
query13	0.45	0.47	0.47
query14	0.97	0.95	0.93
query15	0.59	0.58	0.59
query16	0.32	0.31	0.33
query17	1.12	1.09	1.08
query18	0.21	0.20	0.20
query19	2.01	1.88	1.93
query20	0.02	0.01	0.01
query21	15.45	0.22	0.13
query22	4.78	0.06	0.05
query23	16.11	0.31	0.13
query24	3.00	0.42	0.33
query25	0.11	0.06	0.06
query26	0.73	0.20	0.14
query27	0.05	0.03	0.04
query28	3.57	0.82	0.35
query29	12.50	4.04	3.17
query30	0.28	0.15	0.15
query31	2.77	0.56	0.31
query32	3.22	0.59	0.49
query33	3.19	3.32	3.24
query34	15.44	3.93	3.28
query35	3.21	3.23	3.23
query36	0.54	0.42	0.41
query37	0.09	0.06	0.06
query38	0.05	0.04	0.03
query39	0.04	0.03	0.03
query40	0.17	0.14	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 96.05 s
Total hot run time: 23.99 s

@luwei16

luwei16 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

run feut

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 85.47% (394/461) 🎉
Increment coverage report
Complete coverage report

morningman added a commit that referenced this pull request Sep 18, 2026
…on PRs from master in merge order (#67783 #68034 #68033 #68057 #68094 #68087) (#68151)

Cherry-picked from #67783, #68034, #68033, #68057, #68094, #68087

Batch pick of every merged PR carrying the `incremental-computation`
label that `branch-incremental-computation` does not have yet (no
`incremental-computation-picked` label), in the order they landed on
master (`git log --first-parent`). One commit per PR, each created with
`git cherry-pick -x` so the message ends with `(cherry picked from
commit <master sha>)`. Follows the same convention as #67830, #68017 and
#68073.

| # | Master commit | PR | Title |
|---|---|---|---|
| 1 | e545b13 | #67783 | [fix](policy) Enforce row policies on MOW
time travel |
| 2 | f7a0842 | #68034 | [fix](binlog) Fix missing DELETE events in
row binlog |
| 3 | e85575e | #68033 | [fix](binlog) Preserve row binlog
compaction policy |
| 4 | 21160d7 | #68057 | [fix](binlog) Decouple row binlog
compaction from CCR binlog config |
| 5 | 04aa5a1 | #68094 | [fix](binlog) Persist row binlog config
updates in cloud mode |
| 6 | da8feed | #68087 | [fix](binlog) Report streams with missing
base tables as stale |

Not included on purpose:
- The 20 labelled PRs that already carry
`incremental-computation-picked` (#62606 in the fork point, #67508 via
#67712, the nine of #67830, the six of #68017, the two of #68073, and
#68050 whose content this branch got directly through #68012).
- #68012 carries the label but is a PR against this branch itself
(merged as `6f7c87fa892`); nothing to pick.
- #67820 is still open on master; this branch already carries its
content via #67861.

### Prerequisite check

For every pick I listed the master commits between the fork point
(`efedf10c7e3`) and the pick that touch the same files and are not on
this branch, and checked whether the pick's behavior depends on them.

- **#67783** declares no related PR. It builds on the MOW time-travel
rewrite (`BindRelation.buildMowTimeTravelUnion`, #67480) which is
already here. Two unlabelled master commits overlap: #66770
(authorization plugin SPI: reworks the data-mask / row-filter API of
`LogicalCheckPolicy` and its test) and #67811 (removes the
`isPlayNereidsDump()` check in `CheckPolicy`). Neither is a functional
prerequisite: the fix consists of `getPolicyTable()` unwrapping
`OlapTableWrapper`, `CheckPolicy` collecting the whole filter chain
below the policy mask, and `BindRelation` putting a `LogicalCheckPolicy`
above each union branch — none of that uses the #66770 API. Not picked;
adapted instead (see below).
- **#68034**, **#68033**, **#68087** (#68087 relates to #67173, which is
before the fork point): no unpicked master commit touches any of their
files; the picks applied cleanly and are byte-identical to master.
- **#68057**: only `be/test/cloud/cloud_compaction_test.cpp` overlaps
with the unrelated #67972 (refresh tablet meta of continuously ingested
tablets); auto-merged, the pick only adds new `TEST_F` blocks. Main-code
hunks are byte-identical to master.
- **#68094**: overlaps with #68090 / #67972 / #66598
(`cloud_tablet.cpp`), #67295 / #67618 / #68090 (`base_tablet.{h,cpp}`),
#66598 / #67637 (`meta_service.cpp`), #66598 (`cloud.proto`,
`cloud_tablet_test.cpp`) and #67761 / #66598 / #67637
(`meta_service_test.cpp`). All auto-merged. The fix —
`BaseTablet::binlog_config()` under the meta lock,
`BinlogConfig::operator==`, `CloudTablet::sync_meta()` refreshing the
binlog config, `update_tablet` in the meta service accepting
`binlog_config`, and `CloudSchemaChangeHandler` routing ROW-binlog
property updates through it — does not use anything those commits add.
Its hunks are byte-identical to master except one trailing context line
in `sync_meta()` (`last_sync_tablet_meta_time_s` comes from #67972).

Only #67783 needed adaptation, recorded in its commit message:
- `LogicalCheckPolicy.java`: the conflicting context was master's
`parsePolicyExpression()` helper (#66770), which does not exist here;
the new `getPolicyTable()` is inserted in the same place without it.
- `CheckRowPolicyTest.java`: the data-mask mock is written against this
branch's per-column `AccessControllerManager.evalDataMaskPolicy(...,
column) -> Optional<DataMaskPolicy>` instead of master's
`evalDataMaskPolicies(..., Set<String>) -> Map<String, DataMaskSpec>`.
The masks are the same (concat for the random-distribution table; the
non-movable `k2` mask plus identity masks for the hidden reconstruction
columns of the MOW table). The master-only `Or` import (#66770) is not
carried; `Collections` / `Locale` imports were added because they arrive
with #66770 on master.

### Drift check against master

Each pick's `+`/`-` lines are identical to the master commit's, except
for the #67783 adaptation above. After the six picks, the touched files
still differ from master at `da8feed859d` in: `cloud_tablet.cpp`,
`base_tablet.{h,cpp}`, `cloud_compaction_test.cpp`,
`cloud_tablet_test.cpp`, `meta_service.cpp`, `meta_service_test.cpp`,
`cloud.proto`, `CheckPolicy.java`, `LogicalCheckPolicy.java`,
`CheckRowPolicyTest.java`. Replaying the nine unpicked master commits
listed above (#67637, #67618, #66770, #66598, #67972, #67811, #67761,
#67295, #68090) in a temporary index and removing this branch's own
#67861 (`GetTsoRecoveryTransactions` in `cloud.proto` /
`meta_service_test.cpp`) brings every file to zero diff against master,
except the two `LogicalCheckPolicy.java` / `CheckRowPolicyTest.java`
hunks of #66770 that overlap the adaptation. Nothing else is left over.

### Verification

- FE: `run-fe-ut.sh --run` on this branch (regenerates thrift/protobuf,
compiles fe-core main + test) with the test classes touched by the picks
plus `DeleteFromCommandTest` from #68034's checklist: 5 classes, 58
tests, 0 failures, 0 errors, BUILD SUCCESS — `CheckRowPolicyTest` 9 (the
three tests #67783 adds included), `ExplainTableStreamPlanTest` 24,
`CloudSchemaChangeHandlerTest` 18 (the tests of #68033 and #68094
included), `DropTableStreamTest` 5, `DeleteFromCommandTest` 2.
- FE checkstyle on fe-core: 0 violations.
- BE: `-fsyntax-only` with the flags of the Release build
(`compile_commands.json`, regenerated `gen_cpp` headers incl. the new
`TabletMetaInfoPB.binlog_config`) passes for `cloud/cloud_tablet.cpp`,
`cloud/cloud_storage_engine.cpp`, `storage/olap_server.cpp`,
`storage/tablet/tablet.cpp`, `storage/tablet/base_tablet.cpp`, and with
`-DBE_TEST -fno-access-control` for
`test/cloud/cloud_compaction_test.cpp`,
`test/cloud/cloud_tablet_test.cpp`,
`test/storage/compaction/compaction_task_test.cpp`,
`test/storage/tablet/tablet_test.cpp`.
- Meta service: the two-line `update_tablet` hunk of #68094 only uses
the generated `TabletMetaInfoPB::has_binlog_config()/binlog_config()`
and `TabletMetaCloudPB::mutable_binlog_config()` accessors, all present
in the regenerated headers.
- The two new groovy suites
(`row_binlog_p0/test_row_binlog_mow_light_delete`,
`time_travel_p0/test_mow_time_travel_row_policy`) parse cleanly (groovy
parser check).

---------

Co-authored-by: morrySnow <zhangwenxin@selectdb.com>
Co-authored-by: Luwei <814383175@qq.com>
@luwei16
luwei16 merged commit 44e3ae2 into apache:master Sep 18, 2026
36 of 37 checks passed
morningman added a commit that referenced this pull request Sep 20, 2026
… status through again (#68221)

### What problem does this PR solve?

Issue Number: None

Related PR: #67883, #67820, #67966, #68101

Problem Summary:

`DorisFlightSqlProducer.getFlightInfoStatement` used to rethrow a
`FlightRuntimeException` as is (#67883), so the status the session layer
chose reaches the client: `UNAVAILABLE` from the session's command lock
and `UNAUTHENTICATED` from a closed session (#67900, #67966), and
whatever a refused session is answered with. #67820 rewrote that catch
block into a catch-all that lets only its two incremental-window errors
through (by `doris-error-code` metadata) and wraps every other
`FlightRuntimeException` as `INTERNAL: get flight info statement failed,
<message>` -- the wrapping #67883 had removed. The producer's other
entry points (`setSessionOptions`, `streamMetadata`) still let the
status through and say they do it "as in getFlightInfoStatement".

This PR restores the passthrough ahead of the catch-all. The window
errors are `FlightRuntimeException`s built by `queryFailure`, so
#67820's metadata special case is subsumed and removed; a non-Flight
failure is still wrapped as `INTERNAL` with the same message.

Found through #68101: its `test_connection_quota` asserts the
`RESOURCE_EXHAUSTED` the connection pool answers a refused Flight
session with, and since the pipelines compile a PR merged into master,
every run after #67820 landed got the wrapped `INTERNAL` instead.
morningman added a commit that referenced this pull request Sep 20, 2026
…on PRs from master in merge order (#67820 #68088) (#68236)

Cherry-picked from #67820, #68088

Batch pick of every merged PR carrying the `incremental-computation`
label that `branch-incremental-computation` does not have yet (no
`incremental-computation-picked` label), in the order they landed on
master (`git log --first-parent`). One commit per PR, each ending with
`(cherry picked from commit <master sha>)`. Follows the same convention
as #67830, #68017, #68073 and #68151.

| # | Master commit | PR | Title |
|---|---|---|---|
| 1 | 44e3ae2 | #67820 | [fix](binlog) Track committed TSO and fence
uncertain commits for bounded incremental reads |
| 2 | 3de3a75 | #68088 | [fix](binlog) Require SELECT privilege for
binlog TVF |

Not included on purpose:
- The 25 labelled PRs that already carry
`incremental-computation-picked`.
- #68012 carries the label but is a PR against this branch itself
(merged as `6f7c87fa892`); nothing to pick.

### How #67820 was picked

This branch already carried #67820 through #67861, which backported the
PR's first seven commits (up to `17272039558`) before the PR was merged.
Between that cut and the merge the PR gained six more commits and five
master merges, and the final design differs from what #67861 brought:
the Meta Service recovery RPC (`get_tso_recovery_transactions`) and the
FE startup/periodic recovery scan are gone, replaced by a durable
per-instance commit-TSO fence (`txn_tso_fence_key`, `advance_tso_fence`,
commit-time `TXN_COMMIT_TSO_EXPIRED` check,
`enable_check_commit_tso_fence`), plus the review-feedback and "release
maybe-committed TSO" fixes.

A plain `cherry-pick -x 44e3ae2` conflicts in 23 files because the
branch holds the intermediate design, so commit 1 was built by
replaying, on top of the branch, exactly what the PR gained after the
cut:
- the PR's later commits `d16e67197b2`, `e53291d196b`, `864546d5531`,
`8c55eb086e9`, `8d264ce294a`, `fc4f9969202`;
- the content that landed inside its master merges, identified by
diffing each merge against its `git merge-tree` automerge result:
`c491a293426` (`setEnvTSOService` replaced by
`Mockito.doReturn(tsoService).when(masterEnv).getTSOService()` —
`masterEnv` is the same Mockito delegating mock here since #67813) and
`29f133584b5` (the extra `TSOTransactionTrackerTest` coverage and two
comment removals in `DorisFlightSqlProducer`). The other three merges
only resolved import blocks against master-only code.

The replay then got squashed into one commit with the master PR's
message, the original author, and the `(cherry picked from commit
44e3ae2)` trailer. Adaptations, all
recorded in the commit message:
- `DorisFlightSqlProducer` / `DorisFlightSqlProducerTest` stay under
`service/arrowflight` (the branch lacks the package move of #67866).
- `8d264ce294a` is a no-op here: it removes a `catch
(FlightRuntimeException)` block that #67883 added on master and this
branch never had.
- The branch-only `get_tso_recovery_transactions` RPC, its recovery
scan, the five `TsoRecovery*` Meta Service tests and the NOLINT
suppressions #67861 had added for them are removed, as on master.
- The round-3 `mockVersionHelper()` adaptation in
`CloudGlobalTransactionMgrTest` (no
`VersionHelper.getVersionFromMeta(req, maxAttempts)` overload here,
#66296) is kept.

### Prerequisite check

- **#67820** declares #67181 and #67594 as related; #67181
(`e5a4e725fac`) is before the fork point and #67594 came with #67830.
The rest of what the commit touches on master is import-block and
neighbouring-code drift from unlabelled commits (#67866 / #67883 /
#67966 Arrow Flight and session refactors, #67761
`get_prepare_txn_by_coordinator`, #66598 pre-rowset delete bitmaps,
repair-tablet-index changes); none of it is used by the
fence/committed-TSO logic.
- **#68088** declares no related PR. The hook it implements
(`TableValuedFunctionIf.checkAuth`) and the caller chain
(`CheckPrivileges.visitLogicalTVFRelation` →
`TableValuedFunction.checkAuth` → catalog function) are byte-identical
between this branch and master, and the five-argument
`AccessControllerManager.checkTblPriv` overload exists. Applied cleanly.

### Drift check against master

- **#67820**: every one of the 54 files the master commit touches now
contains the pick's content — the master commit reverse-applies cleanly
per file onto this branch (50 files), and the four files where only the
surrounding context differs (`config.h`, `meta_service_txn.cpp`,
`StmtExecutor.java`, `StmtExecutorTest.java`) contain every added line
and none of the removed ones. 33 of the 54 files are byte-identical to
master at `44e3ae2b951`, including all of `fe/.../tso/`,
`CloudGlobalTransactionMgr.java`, `MetaServiceProxy.java`,
`keys.{h,cpp}`, `meta_service.h` and the regression suite/output. The
remaining differences are unrelated master-only or branch-only code from
unlabelled commits (#67761, #66598, #67866/#67883/#67966,
repair-tablet-index, meta-cache columns, recycler configs) plus the
documented `mockVersionHelper()` adaptation; no line in the
committed-TSO/fence domain is left over from #67861.
- **#68088**: all three files are byte-identical to master at
`3de3a756f74`.

### Verification

- FE: `run-fe-ut.sh --run` on this branch (regenerates thrift/protobuf,
compiles fe-core main + test) with every test class the picks touch: 12
classes, 175 tests, 0 failures, 0 errors, BUILD SUCCESS —
`TSOServiceTest` 38, `CloudGlobalTransactionMgrTest` 37,
`StmtExecutorTest` 27, `MetaServiceProxyTest` 22, `OlapScanNodeTest` 12,
`TimeBasedChangeVisibleWaiterTest` 12, `TSOTransactionTrackerTest` 9
(the four tests added inside the PR's last master merge included),
`DorisFlightSqlProducerTest` 7, `TsoStatusMetadataGeneratorTest` 5,
`CloudCommittedTsoTest` 3, `SchemaTableTest` 2,
`TableBinlogFunctionAuthTest` 1 (#68088). The `@Test` counts of the
touched classes equal master's.
- FE checkstyle on fe-core: 0 violations.
- Meta Service: `-fsyntax-only` with the flags of `cloud/CMakeLists.txt`
(`-Wall -Werror`, regenerated `gen_cpp/cloud.pb.h` with
`AdvanceTsoFence*` / `TxnTsoFencePB` and without
`GetTsoRecoveryTransactions*`) on `meta_service_txn.cpp`, `keys.cpp`,
`http_encode_key.cpp`, `bvars.cpp` and, with `-DUNIT_TEST -DBE_TEST
-fno-access-control`, on `meta_service_test.cpp`, `keys_test.cpp`,
`http_encode_key_test.cpp`, `meta_service_helper_test.cpp`,
`txn_lazy_commit_test.cpp`: no diagnostic in any line the pick touches
(the only errors are the pre-existing macOS-only `pthread_setname_np` /
`int64_t`-vs-`long` ones in untouched 2024/2025 code). clang-format 16
is clean on all 14 touched cloud files.
- No BE file changes in this round (the BE side of #67820 was already
byte-identical to master via #67861).
- The new `auth_p0/test_binlog_tvf_auth.groovy` and the two #67820
suites parse cleanly (groovy parser check).

---------

Co-authored-by: Luwei <814383175@qq.com>
Co-authored-by: morrySnow <zhangwenxin@selectdb.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.

5 participants