Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStore.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStore.java (revision 1615869) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStore.java (working copy) @@ -381,10 +381,9 @@ DataRecord dataRecord = delegate.getRecord(identifier); boolean success = (maxLastModifiedTime <= 0) || dataRecord.getLastModified() <= maxLastModifiedTime; - if (!success) { - return false; + if (success) { + ((MultiDataStoreAware) delegate).deleteRecord(identifier); } - ((MultiDataStoreAware) delegate).deleteRecord(identifier); } } return true; Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java (revision 1615869) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/MarkSweepGarbageCollector.java (working copy) @@ -289,8 +289,10 @@ IOUtils.closeQuietly(writer); } if(!exceptionQueue.isEmpty()) { - LOG.warn("Unable to delete some blob entries from the blob store. Details around such blob entries " + - "can be found in [{}]", fs.getGarbage().getAbsolutePath()); + LOG.warn("Unable to delete some blob entries from the blob store. " + + "This may happen if the blob modified time is greater than the configured maxLastModifiedInterval ({}). " + + "Details around such blob entries " + + "can be found in [{}]", maxLastModifiedInterval, fs.getGarbage().getAbsolutePath()); } LOG.debug("Ending sweep phase of the garbage collector"); return count; @@ -336,9 +338,11 @@ public void run() { try { LOG.debug("Blob ids to be deleted {}", ids); - boolean deleted = blobStore.deleteChunks(ids,getLastMaxModifiedTime()); + boolean deleted = blobStore.deleteChunks(ids, getLastMaxModifiedTime()); if (!deleted) { - exceptionQueue.addAll(ids); + // Only log and do not add to exception queue since some blobs may not match the + // lastMaxModifiedTime criteria. + LOG.debug("Some blobs were not deleted from the batch : [{}]", ids); } } catch (Exception e) { LOG.warn("Error occurred while deleting blob with ids [{}]", ids, e); @@ -415,7 +419,7 @@ try { bufferWriter = new BufferedWriter( new FileWriter(fs.getAvailableRefs())); - Iterator idsIter = blobStore.getAllChunkIds(getLastMaxModifiedTime()); + Iterator idsIter = blobStore.getAllChunkIds(0); List ids = Lists.newArrayList(); while (idsIter.hasNext()) { @@ -434,8 +438,7 @@ // sort the file fs.sort(fs.getAvailableRefs()); - LOG.debug("Number of blobs present in BlobStore : [{}] which have " + - "been last modified before [{}]", blobsCount, timestampToString(getLastMaxModifiedTime())); + LOG.debug("Number of blobs present in BlobStore : [{}] ", blobsCount); } finally { IOUtils.closeQuietly(bufferWriter); }