Address review comments
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardRecoveryCoordinator.java
index 70a701075ec6b5867e7a765629fcc65d6b72d8cb..5b7f289eed4ea2fa37296a07b5e47e54af2201ac 100644 (file)
@@ -72,7 +72,7 @@ class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {
 
     private File writeRoot(final String kind, final NormalizedNode<?, ?> node) {
         final File file = new File(System.getProperty("karaf.data", "."),
-            "failed-" + kind + "-snapshot-" + shardName + ".xml");
+            "failed-recovery-" + kind + "-" + shardName + ".xml");
         NormalizedNodeXMLOutput.toFile(file, node);
         return file;
     }
@@ -97,11 +97,10 @@ class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {
         try {
             store.applyRecoverySnapshot(snapshot);
         } catch (Exception e) {
-            log.error("{}: failed to apply snapshot {}", shardName, snapshot, e);
-
-            final File f = writeRoot("recovery", snapshot.getRootNode().orElse(null));
+            final File f = writeRoot("snapshot", snapshot.getRootNode().orElse(null));
             throw new IllegalStateException(String.format(
-                    "%s: Failed to apply recovery snapshot. Node data was written to file %s", shardName, f), e);
+                    "%s: Failed to apply recovery snapshot %s. Node data was written to file %s",
+                    shardName, snapshot, f), e);
         }
     }