924060929 commented on code in PR #68238:
URL: https://github.com/apache/doris/pull/68238#discussion_r4070431122
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonMetadataOps.java:
##########
@@ -146,29 +146,26 @@ public void afterCreateDb() {
}
@Override
- public void dropDbImpl(String dbName, boolean ifExists, boolean force)
throws DdlException {
+ public boolean dropDbImpl(String dbName, boolean ifExists, boolean force)
throws DdlException {
try {
- executionAuthenticator.execute(() -> {
- performDropDb(dbName, ifExists, force);
- return null;
- });
+ return executionAuthenticator.execute(() -> performDropDb(dbName,
ifExists, force));
} catch (Exception e) {
throw new DdlException(
"Failed to drop database: " + dbName + ", error message is:" +
e.getMessage(), e);
}
}
- private void performDropDb(String dbName, boolean ifExists, boolean force)
throws DdlException {
+ private boolean performDropDb(String dbName, boolean ifExists, boolean
force) throws DdlException {
ExternalDatabase dorisDb = dorisCatalog.getDbNullable(dbName);
if (dorisDb == null) {
if (ifExists) {
LOG.info("drop database[{}] which does not exist", dbName);
// Database does not exist and IF EXISTS is specified; treat
as no-op.
- return;
+ return false;
} else {
ErrorReport.reportDdlException(ErrorCode.ERR_DB_DROP_EXISTS,
dbName);
// ErrorReport.reportDdlException is expected to throw
DdlException.
Review Comment:
Fixed in 1d4f421bfeae13d653a71ab8919c7eb5a55d45f8.
ExternalMetadataOps.dropDb now calls a new afterDropDbNoOp(dbName) hook when
dropDbImpl reports no remote mutation, keeping the journaling decision separate
from local cleanup. PaimonMetadataOps.afterDropDbNoOp retires the catalog's
legacy database objects (suppressing per-database engine callbacks, since no
remote mutation happened and no SDK flush is justified), so a no-op DROP
DATABASE IF EXISTS with a lost mode-2 mapping no longer leaves the canonical
ExternalDatabase behind. Added
testMode2UnresolvedLeaderNoOpDropRetiresCanonicalLegacyDatabase; the full
affected suite passes (136 tests).
--
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]