HTHou commented on code in PR #15604:
URL: https://github.com/apache/iotdb/pull/15604#discussion_r2113133176
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java:
##########
@@ -3064,22 +3082,119 @@ public void loadNewTsFile(
false);
}
+ onTsFileLoaded(newTsFileResource, isFromConsensus, lastReader);
logger.info("TsFile {} is successfully loaded in unsequence list.",
newFileName);
} catch (final DiskSpaceInsufficientException e) {
logger.error(
"Failed to append the tsfile {} to database processor {} because the
disk space is insufficient.",
tsfileToBeInserted.getAbsolutePath(),
tsfileToBeInserted.getParentFile().getName());
throw new LoadFileException(e);
+ } catch (Exception e) {
+ throw new LoadFileException(e);
} finally {
writeUnlock();
+ if (lastReader != null) {
+ try {
+ lastReader.close();
+ } catch (Exception e) {
+ logger.warn("Cannot close last reader after loading TsFile {}",
newTsFileResource, e);
+ }
+ }
// TODO: do more precise control
Review Comment:
This TODO can be removed now?
--
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]