github-actions[bot] commented on code in PR #66287:
URL: https://github.com/apache/doris/pull/66287#discussion_r3687116820
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/BaseTableStream.java:
##########
@@ -113,6 +115,9 @@ public BaseTableStream(String streamName, List<Column>
fullSchema, TableIf baseT
}
public TableIf getBaseTableNullable() {
+ if (baseTable instanceof Table && ((Table) baseTable).isDropped) {
Review Comment:
**[P2] Preserve the latest base identity before clearing it**
Once this branch clears the dropped table, `getBaseTableNullable()` returns
null and `Env.getDdlStmt()` emits `ON TABLE UNKNOWN`, making `SHOW CREATE
STREAM` non-round-trippable during a recoverable drop. Falling back directly to
`TableStreamBaseTableInfo` is not enough after `old` is renamed/recovered as
`new` and dropped again: that descriptor still says `old`, while the recycle
bin can recover only `new`. Preserve the latest same-ID live qualifiers in
replay-equivalent state before clearing them (or resolve that recycle entry by
ID), and cover both a simple drop and rename/recover-as followed by re-drop.
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/TableStreamManager.java:
##########
@@ -314,27 +314,17 @@ public void
fillTableStreamValuesMetadataResult(List<TRow> dataBatch) {
trow.addToColumnValue(new
TCell().setStringVal(stream.getScanTypeString()));
// STREAM_COMMENT
trow.addToColumnValue(new
TCell().setStringVal(stream.getComment()));
+ List<String> baseTableQualifiers =
stream.getBaseTableFullQualifiers();
+ // BASE_TABLE_NAME
+ trow.addToColumnValue(new
TCell().setStringVal(baseTableQualifiers.get(2)));
+ // BASE_TABLE_DB
+ trow.addToColumnValue(new
TCell().setStringVal(baseTableQualifiers.get(1)));
+ // BASE_TABLE_CTL
+ trow.addToColumnValue(new
TCell().setStringVal(baseTableQualifiers.get(0)));
+ // BASE_TABLE_TYPE
TableIf baseTable = stream.getBaseTableNullable();
- if (baseTable == null) {
- // BASE_TABLE_NAME
- trow.addToColumnValue(new
TCell().setStringVal("N/A"));
- // BASE_TABLE_DB
- trow.addToColumnValue(new
TCell().setStringVal("N/A"));
- // BASE_TABLE_CTL
- trow.addToColumnValue(new
TCell().setStringVal("N/A"));
- // BASE_TABLE_TYPE
- trow.addToColumnValue(new
TCell().setStringVal("N/A"));
- } else {
- List<String> baseTableQualifiers =
baseTable.getFullQualifiers();
- // BASE_TABLE_NAME
- trow.addToColumnValue(new
TCell().setStringVal(baseTableQualifiers.get(2)));
- // BASE_TABLE_DB
- trow.addToColumnValue(new
TCell().setStringVal(baseTableQualifiers.get(1)));
- // BASE_TABLE_CTL
- trow.addToColumnValue(new
TCell().setStringVal(baseTableQualifiers.get(0)));
- // BASE_TABLE_TYPE
- trow.addToColumnValue(new
TCell().setStringVal(baseTable.getType().name()));
- }
+ trow.addToColumnValue(new TCell().setStringVal(
Review Comment:
**[P2] Derive the row from one availability snapshot**
`baseTable` is reused only for `BASE_TABLE_TYPE`; `isDisabled()`,
`isStale()`, and `getStaleReason()` each resolve it again. Because base-table
drop/recovery uses different locks from this stream read lock, a recovery after
the type lookup can emit `N/A` with enabled/non-stale state, while a drop can
emit `OLAP` with disabled/stale state. Resolve availability once per row and
derive all four fields from that snapshot while still combining the persisted
flags; a latch-controlled DDL test would cover the interleaving.
--
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]