devmadhuu commented on code in PR #9904:
URL: https://github.com/apache/ozone/pull/9904#discussion_r2940339019
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStoreAbstractIterator.java:
##########
@@ -145,6 +191,11 @@ public final void removeFromDB() throws
RocksDatabaseException, CodecException {
if (rocksDBTable == null) {
throw new UnsupportedOperationException("remove");
}
+ if (isDbClosed()) {
+ LOG.warn("Skipping removeFromDB for table {}: underlying RocksDB is
closed",
+ rocksDBTable.getName());
+ return;
Review Comment:
The method signature declares throws `RocksDatabaseException`. All other DB
operations in this codebase throw when the DB is closed. Silently skipping a
deletion means the caller has no way to know the delete was not performed.
Consider throwing instead for consistency.
```suggestion
throw new RocksDatabaseException(
"Cannot removeFromDB: underlying RocksDB for table "
+ rocksDBTable.getName() + " is closed");
```
--
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]