seawinde commented on code in PR #66287:
URL: https://github.com/apache/doris/pull/66287#discussion_r3702079665
##########
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) {
+ baseTable = null;
Review Comment:
Fixed in `6baebd9e78a`. `getBaseTableNullable()` now snapshots the volatile
field into `cachedBaseTable` and uses that local for the dropped check and
return path. Clearing the shared cache can no longer change the value being
dereferenced by another reader.
##########
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
Review Comment:
Fixed in `6baebd9e78a`. `table_streams` now resolves the base table first
and uses `baseTable.getFullQualifiers()` while it is available. Stored
qualifiers are only the final fallback when neither the live table nor a
same-ID recycle-bin entry is available. The unit test covers `ALTER TABLE ...
RENAME` and `RECOVER TABLE ... AS`.
##########
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:
Fixed in `6baebd9e78a`. `fillTableStreamValuesMetadataResult()` resolves
`baseTable` once per `TRow` and passes that snapshot to the qualifier,
disabled, stale, and stale-reason calculations. The overloads still combine the
snapshot with the persisted `disabled`/`stale` flags, so one row can no longer
mix pre-drop/post-drop or pre-recovery/post-recovery availability.
##########
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:
Fixed in `6baebd9e78a`. For an unavailable internal base table, display
qualifiers are resolved from the recycle bin by `(dbId, tableId)` before
falling back to creation-time qualifiers. `SHOW CREATE STREAM` now uses those
qualifiers instead of `UNKNOWN`. Coverage includes a simple recoverable drop,
rename then drop, Gson deserialization as a replay/restart-equivalent path,
`RECOVER TABLE ... AS`, and a second drop retaining the recovered name.
--
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]