Doris-Breakwater commented on issue #71271:
URL: https://github.com/apache/doris/issues/71271#issuecomment-7337871965

   This is a BE clone metadata bug in the Doris 4.1.5 source. The reported 
replica-specific failures and rowset metadata fit that code path. This 
assessment is based on source inspection. Cluster reproduction is pending.
   
   **What the source confirms**
   
   - After downloading a snapshot, `EngineCloneTask` calls 
`convert_rowset_ids`. When the destination tablet exists, 
`SnapshotManager::_rename_index_ids` looks up each incoming index by column 
unique ID, index type, and suffix. `TabletSchema::get_index` returns the first 
match. Both `txt` indexes share that key, so the second entry can acquire the 
first entry’s ID while retaining its own name and analyzer properties. The 
current `branch-4.1` source still has this lookup. [Clone 
conversion](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/task/engine_clone_task.cpp#L467-L470)
 · 
[Remap](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/snapshot/snapshot_manager.cpp#L377-L396)
 · 
[Lookup](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/tablet/tablet_schema.cpp#L1604-L1614)
 · [4.1 
branch](https://github.com/apache/doris/blob/a5d6d97d4d1c01697b8cd581d52f9eddb503b482/be/src/storage/snapshot/snapshot_manager.cpp#L377-L396)
   - Incremental clone adds the converted rowsets to the existing tablet. Each 
rowset prefers its own embedded schema, which explains how a correct 
tablet-level schema can coexist with broken rowset schemas. When a scan or 
compaction initializes both inverted-index readers for the field, the selector 
rejects the duplicate ID before analyzer selection. [Incremental clone 
finish](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/task/engine_clone_task.cpp#L886-L916)
 · [Rowset 
schema](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/rowset/rowset.cpp#L59-L63)
 · [Reader 
registration](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/index/inverted/inverted_index_iterator.cpp#L38-L53)
 · [Duplicate 
check](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/index/inverted/inverted_index_selector.cpp#L30-L46)
   - Full clone into an **existing** tablet also goes through conversion. A 
clone to a **new** destination tablet passes a null target schema and skips the 
index-ID rewrite. Treat those as separate cases when validating a fix or 
recovery. [Existing and new 
destinations](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/task/engine_clone_task.cpp#L235-L306)
 · [Target schema 
lookup](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/snapshot/snapshot_manager.cpp#L186-L191)
   
   **Evidence to confirm the live case.** Please share sanitized 
`/api/meta/header` excerpts for one matching rowset version from the clone 
source and affected destination, including the tablet-level and rowset-level 
index IDs, names, column unique IDs, suffixes, and analyzer properties. The 
destination BE’s `begin to finish incremental clone` log for that tablet, the 
first failing scan or compaction stack, and the BE build SHA or image digest 
would tie the metadata change to the clone and build.
   
   **Suggested fix and regression.** Preserve an incoming ID when it belongs to 
the same index definition on the target. When remapping is required, resolve a 
unique matching definition and verify that the resulting IDs agree with the 
copied index files. V3 entries are addressed by `(index_id, suffix)`, so a 
metadata-only rewrite to a different ID needs particular care. Use the supplied 
SQL to force incremental clone and assert that both IDs survive, each analyzer 
returns the same results as on the healthy replica, and cumulative compaction 
succeeds. Add a full-clone-fallback case for an existing tablet. For 
already-affected replicas, validate a fresh replacement from a healthy source 
in staging and check both analyzer queries and compaction before returning it 
to service. [V3 index entry 
lookup](https://github.com/apache/doris/blob/4.1.5-release/be/src/storage/index/index_file_reader.cpp#L85-L116)
   
   Breakwater-GitHub-Analysis-Slot: slot_546959f531a9
   


-- 
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