lhotari commented on code in PR #24344:
URL: https://github.com/apache/pulsar/pull/24344#discussion_r2106704499


##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java:
##########
@@ -204,11 +204,16 @@ public CompletableFuture<Void> offload(ReadHandle 
readHandle,
             final BlobStore writeBlobStore = 
getBlobStore(config.getBlobStoreLocation());
             log.info("offload {} uuid {} extraMetadata {} to {} {}", 
readHandle.getId(), uuid, extraMetadata,
                 config.getBlobStoreLocation(), writeBlobStore);
-            if (readHandle.getLength() == 0 || !readHandle.isClosed() || 
readHandle.getLastAddConfirmed() < 0) {
+            if (!readHandle.isClosed() || readHandle.getLastAddConfirmed() < 
0) {
                 promise.completeExceptionally(
                         new IllegalArgumentException("An empty or open ledger 
should never be offloaded"));
                 return;
             }
+            if (readHandle.getLength() <= 0) {
+                log.warn("[{}] has a ledger [{}] with a zero length, but it 
contains {} entries. since it contains"
+                    + " entries, attempts to offload", topicName, 
readHandle.getLastAddConfirmed() + 1,
+                    readHandle.getId());

Review Comment:
   ```suggestion
                   log.warn("[{}] Ledger [{}] has a zero length, but it 
contains {} entries. "
                       + " Attemping to offload ledger since it contains 
entries.", topicName, readHandle.getId(), readHandle.getLastAddConfirmed() + 1);
   ```



##########
tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreManagedLedgerOffloader.java:
##########
@@ -204,11 +204,16 @@ public CompletableFuture<Void> offload(ReadHandle 
readHandle,
             final BlobStore writeBlobStore = 
getBlobStore(config.getBlobStoreLocation());
             log.info("offload {} uuid {} extraMetadata {} to {} {}", 
readHandle.getId(), uuid, extraMetadata,
                 config.getBlobStoreLocation(), writeBlobStore);
-            if (readHandle.getLength() == 0 || !readHandle.isClosed() || 
readHandle.getLastAddConfirmed() < 0) {
+            if (!readHandle.isClosed() || readHandle.getLastAddConfirmed() < 
0) {
                 promise.completeExceptionally(
                         new IllegalArgumentException("An empty or open ledger 
should never be offloaded"));
                 return;
             }
+            if (readHandle.getLength() <= 0) {
+                log.warn("[{}] has a ledger [{}] with a zero length, but it 
contains {} entries. since it contains"
+                    + " entries, attempts to offload", topicName, 
readHandle.getLastAddConfirmed() + 1,
+                    readHandle.getId());

Review Comment:
   ```suggestion
                   log.warn("[{}] Ledger [{}] has zero length, but it contains 
{} entries. "
                       + " Attemping to offload ledger since it contains 
entries.", topicName, readHandle.getId(), readHandle.getLastAddConfirmed() + 1);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to