BUG-8371: raise unknown history log to warn
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / LeaderFrontendState.java
index 24de062227878bb1151e2e82247c3fb2f3390516..8704f2ab0cd9d33e02ab6b53a65d1aa5733fc60b 100644 (file)
@@ -134,7 +134,7 @@ final class LeaderFrontendState implements Identifiable<ClientIdentifier> {
         // end up resurrecting a purged history.
         if (purgedHistories.contains(UnsignedLong.fromLongBits(id.getHistoryId()))) {
             LOG.debug("{}: rejecting purged request {}", persistenceId, request);
-            throw new DeadHistoryException(lastSeenHistory.longValue());
+            throw new DeadHistoryException(purgedHistories);
         }
 
         // Update last history we have seen
@@ -188,7 +188,12 @@ final class LeaderFrontendState implements Identifiable<ClientIdentifier> {
             if (lhId.getHistoryId() != 0) {
                 history = localHistories.get(lhId);
                 if (history == null) {
-                    LOG.debug("{}: rejecting unknown history request {}", persistenceId, request);
+                    if (purgedHistories.contains(UnsignedLong.fromLongBits(lhId.getHistoryId()))) {
+                        LOG.warn("{}: rejecting request {} to purged history", persistenceId, request);
+                        throw new DeadHistoryException(purgedHistories);
+                    }
+
+                    LOG.warn("{}: rejecting unknown history request {}", persistenceId, request);
                     throw new UnknownHistoryException(lastSeenHistory);
                 }
             } else {