Ripening opened a new pull request, #71408:
URL: https://github.com/apache/doris/pull/71408

   ### Background
   
   `OlapTable` tracks table state changes via `table_version` (persisted via 
EditLog in Non-Cloud mode, and stored in MetaService FDB with 
`CloudFEVersionSynchronizer` sync in Cloud mode). Previously, only DML and 
select partition operations advanced `table_version`, leaving most DDL 
operations untracked.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: None
   PR Type: Enhancement
   
   Problem Summary:
   
   Consumers relying on `table_version` missed DDL-driven metadata and schema 
changes, with inconsistent behavior across Non-Cloud and Cloud modes. This PR 
broadens `table_version` advancement across async and sync DDL paths in both 
modes while preserving rolling-upgrade compatibility (legacy `0L` EditLog 
replay and `UNIMPLEMENTED` RPC fallback). Most of the diff is unit tests 
(~1,603 of ~2,391 added lines).
   
   ### Details
   
   - **Change map:** ~788 lines prod (31 files), ~1,603 lines tests (3 files), 
0 generated, 0 docs.
     - **Proto & MetaService (~200 prod + 217 C++ UT):** `update_table_version` 
RPC (single/batch atomic FDB txn), `commit_index` `need_update_table_version`, 
bvars, and `meta_service_test.cpp`.
     - **FE infra (~160 prod):** Non-Cloud monotonic guard (`TableAttributes` / 
`OlapTable.advanceVisibleVersion()`) and 
`CloudInternalCatalog.updateCloudTableVersion` (variadic, `KV_TXN_CONFLICT` 
retry, `UNIMPLEMENTED` fallback).
     - **FE DDL & EditLog (~428 prod + 1,386 Java UT):** wires `RECOVER 
PARTITION`, async Schema Change / Rollup, `BUILD INDEX`, `REPLACE TABLE`, light 
schema change, `DROP ROLLUP`, `RENAME`, `MODIFY COMMENT`, and `ALTER TABLE SET 
PROPERTIES` across 11 EditLog classes; adds `TableVersionCatalogTest` and 
`TableVersionAlterTest`.
   - **Before and after:** Before, DDL operations left `table_version` 
unchanged; after, the listed DDLs advance `table_version` consistently in both 
Non-Cloud (EditLog + replay) and Cloud (MetaService FDB + FE cache sync).
   - **Configs and defaults:** None.
   - **Impact on existing users:** `table_version` now increments on covered 
DDLs. Rolling upgrades stay compatible (legacy `0L` EditLog ignored in 
Non-Cloud; `UNIMPLEMENTED` fallback in Cloud), and Cloud sync DDLs call RPC 
before mutating FE memory for failure atomicity.
   
   ### Testing
   
   - **Checkstyle (local):** `mvn -o -T 4 checkstyle:check -pl fe-core` — 0 
violations.
   - **New FE UTs (local):** `TableVersionCatalogTest` (5/5) & 
`TableVersionAlterTest` (4/4) — PASS.
   - **Existing FE UTs (local):** 135/135 PASS across 8 related alter/catalog 
test classes.
   - **MetaService C++ UT (local):** `meta_service_test.cpp` new cases — PASS.
   - **Cluster regression:** Deferred to CI pipelines on this PR.
   
   ### Notes for Reviewers
   
   - `BUILD INDEX` advances `table_version` once per table on the final 
partition job (if any partition succeeded); `REPLACE TABLE` updates both tables 
in one atomic MetaService RPC.
   - Out of scope: empty partition `ADD/DROP PARTITION`, Compaction, tablet 
migration, `ANALYZE`, `GRANT`, `DROP TABLE`.
   
   ### Release note
   
   Broaden `table_version` updates to cover DDL operations (schema change, 
rollup, build index, replace table, recover partition, rename, modify comment, 
and alter table properties) in both Non-Cloud and Cloud modes.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: No
   - Pre-submission status: Partially verified: local C++/FE unit tests and 
Checkstyle pass; end-to-end cluster regression will be verified via CI.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to