Skip to content

Commit

Permalink
Fixed the new DeleteDataFileCommand where it was too unforgiving to d…
Browse files Browse the repository at this point in the history
…atafiles with broken or missing physical files.

(this was breaking some RA tests, among other things).
  • Loading branch information
landreev committed May 2, 2017
1 parent 96e5762 commit 423d1da
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {

try {
dataFileIO = doomed.getDataFileIO();
dataFileIO.open();
} catch (IOException ioex) {
throw new CommandExecutionException("Failed to initialize physical access driver.", ioex, this);
}
Expand All @@ -92,6 +91,7 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
// auxiliary files, we'll just leave an error message in the
// log file and proceed deleting the database object.
try {
dataFileIO.open();
dataFileIO.deleteAllAuxObjects();
} catch (IOException ioex) {
Logger.getLogger(DeleteDataFileCommand.class.getName()).log(Level.SEVERE, "Error deleting Auxiliary file(s) while deleting DataFile {0}", doomed.getStorageIdentifier());
Expand All @@ -105,12 +105,9 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
try {
physicalFileExists = dataFileIO.exists();
} catch (IOException ioex) {
// The IO exception here IS a fatal condition - it likely means
// that we could not even reach the physical storage system
// where the file is supposed to live; so we are likely
// not going to be able to delete it there either.

throw new CommandExecutionException("Failed to initialize physical access driver.", ioex, this);
// We'll assume that an exception here means that the file does not
// exist; so we can skip trying to delete it.
physicalFileExists = false;
}

if (physicalFileExists) {
Expand Down

0 comments on commit 423d1da

Please sign in to comment.