In `SegmentDeletionManager.removeAgedDeletedSegmen...
# pinot-dev
, there’s this bit of code:
Copy code
try {
        // Check that the directory for deleted segments exists.
        if (!pinotFS.isDirectory(deletedDirURI)) {
          LOGGER.warn("Deleted segment directory {} does not exist or it is not directory.", deletedDirURI.toString());
But if we’ve never deleted any segments, then this directory won’t exist yet. So shouldn’t this check be “if it exists && it’s not a directory”? Otherwise we get regular warnings in our log files, which trigger an alert, etc, etc.
Also the
call throws a
in this case, which isn’t caught in this method, bubbles, up, and generates a
Could not get file status for hdfs:///user/hadoop/pinot-beta/pinot-segments//Deleted_Segments
Which is what really causes our alerting system to go off…
Here's what I'd think:
Copy code
1. What is the expected behavior wrt Deleted Segments directory? Is it that if directory does not exist then we don't save, or is it that we always save, in which case we should create this directory in ControllerStarter.
2. Depending on what's the consensus on 1, we can either assert or make this a debug message after adding Ken's suggested check, instead of warn.
IMHO, we should not force DeletedSegments directory to be created (unless user specifies in a conf), and make this a debug message, along with exists() check.
Thoughts welcome.
I don’t know enough about how segment retention is designed to work, so hard for me to weigh in with anything useful, sorry.
What would be the “user specified in conf” approach? Some new flag?
Similar to dataDir
For now, may be just file a PR with your suggested fix, we can discuss there.
I file an issue, need to set aside time to deal with it (for now we just added that directory to HDFS). See