seawinde opened a new pull request, #66287: URL: https://github.com/apache/doris/pull/66287
### What problem does this PR solve? Issue Number: N/A Related PR: https://github.com/yujun777/doris/pull/29 Problem Summary: Dropping a stream base table left the stream enabled and non-stale in `information_schema.table_streams`. Recoverable drops could also keep using the cached dropped table instead of resolving the persisted base table identity. **Root cause:** `BaseTableStream.getBaseTableNullable()` retained a cached `Table` after it was marked dropped, while `isDisabled()`, `isStale()`, and `getStaleReason()` only returned their persisted flags. **Change Summary:** | File | Change Description | |------|-------------------| | `BaseTableStream.java` | Invalidate dropped cached tables and derive availability and stale status from base table resolution. | | `TableStreamManager.java` | Preserve base table qualifiers when the table is unavailable and report its type as `N/A`. | | `TableStreamBaseTableInfo.java` | Log expected unavailable base table resolution at debug level. | | `DropTableStreamTest.java` | Cover recoverable drop, recovery, force drop, and same-name table recreation. | | Regression test | Cover the IVM stream lifecycle and incremental refresh after recovery. | ```mermaid stateDiagram-v2 [*] --> Available Available --> Stale: drop base table Stale --> Available: recover original table ID Stale --> Stale: create same-name table with new ID ``` ### Release note Streams whose base tables are unavailable are now reported disabled and stale. ### Check List (For Author) - Test - [ ] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason Local verification: - `./run-fe-ut.sh --run org.apache.doris.catalog.DropTableStreamTest` (4 tests) - `env DISABLE_BUILD_UI=ON ./build.sh --fe` - Regression coverage is included; buildall is requested for cluster validation. - Behavior changed: - [ ] No. - [x] Yes. Streams are disabled and stale while their base tables are unavailable, and recover when the original table ID returns. - Does this need documentation? - [x] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label -- 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]
