924060929 commented on code in PR #69255:
URL: https://github.com/apache/doris/pull/69255#discussion_r4558793052
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -647,6 +658,7 @@ public void recoverDatabase(String dbName, long dbId,
String newDbName) throws D
if (!Strings.isNullOrEmpty(newDbName)) {
db.setNameWithLock(newDbName);
}
+ Env.getCurrentEnv().registerDbFunctionsById(db);
Review Comment:
Agreed that losing a database when RECOVER fails after removing it from the
recycle bin is a pre-existing recovery issue. The latest change correctly
preserves function IDs and Python resources during a recoverable DROP,
addressing the normal DROP/RECOVER case.
The remaining concern is the new `id2Function` index introduced by this PR:
if RECOVER fails at the catalog-lock acquisition or destination-name recheck,
the database is in neither the catalog nor the recycle bin, but its function
IDs remain indexed. Subsequent BE reports therefore keep treating those orphan
functions as live and never schedule cleanup; with `auto_suspend=-1`, their
resources can remain resident indefinitely. This new index-lifecycle gap should
be handled in this PR, even though the underlying recovery failure behavior
predates it.
Restoring the database to the recycle bin on recovery failure is a
reasonable fix direction: it preserves recoverability and keeps the retained
index entries and resources consistent with an actual owner. Please cover a
failure after recycle-bin removal, such as catalog-lock acquisition failure or
a concurrent destination-name conflict. No Function ID change is needed.
--
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]