You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/11/18 09:25:27 UTC
[GitHub] [pulsar] ZHr-UChiHa opened a new issue, #18536: [Bug] pulsar offload to S3 service failed, because BlobStoreManagedLedgerOffloader#offload close BlockAwareSegmentInputStream twice and throw exception.
ZHr-UChiHa opened a new issue, #18536:
URL: https://github.com/apache/pulsar/issues/18536
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
2.10.1
### Minimal reproduce step
S3 service use huawei cloud obs service,
BlobStoreManagedLedgerOffloader#offload line: 214
when trigger offload, blockStream will close both writeBlobStore.uploadMultipartPart(mpu, partId, partPayload) and try (BlockAwareSegmentInputStream blockStream = new BlockAwareSegmentInputStreamImpl(
readHandle, startEntry, blockSize)) will close blockStream, when finish try blockStream.close will throw exception
Illegal ReferenceCountException: refCnt: 0, decrement: 1
code:
try {
long startEntry = 0;
int partId = 1;
long entryBytesWritten = 0;
while (startEntry <= readHandle.getLastAddConfirmed()) {
int blockSize = BlockAwareSegmentInputStreamImpl
.calculateBlockSize(config.getMaxBlockSizeInBytes(), readHandle, startEntry, entryBytesWritten);
try (BlockAwareSegmentInputStream blockStream = new BlockAwareSegmentInputStreamImpl(
readHandle, startEntry, blockSize)) {
Payload partPayload = Payloads.newInputStreamPayload(blockStream);
partPayload.getContentMetadata().setContentLength((long) blockSize);
partPayload.getContentMetadata().setContentType("application/octet-stream");
parts.add(writeBlobStore.uploadMultipartPart(mpu, partId, partPayload));
log.debug("UploadMultipartPart. container: {}, blobName: {}, partId: {}, mpu: {}",
config.getBucket(), dataBlockKey, partId, mpu.id());
indexBuilder.addBlock(startEntry, partId, blockSize);
if (blockStream.getEndEntryId() != -1) {
startEntry = blockStream.getEndEntryId() + 1;
} else {
// could not read entry from ledger.
break;
}
entryBytesWritten += blockStream.getBlockEntryBytesCount();
partId++;
}
dataObjectLength += blockSize;
}
writeBlobStore.completeMultipartUpload(mpu, parts);
mpu = null;
} catch (Throwable t) {
try {
if (mpu != null) {
writeBlobStore.abortMultipartUpload(mpu);
}
} catch (Throwable throwable) {
log.error("Failed abortMultipartUpload in bucket - {} with key - {}, uploadId - {}.",
config.getBucket(), dataBlockKey, mpu.id(), throwable);
}
promise.completeExceptionally(t);
return;
}

### What did you expect to see?
no exception occurs, ledger log send to obs file success, but actually when send part file sucess once, code throw exception lead to delete uploaded file in catch exception code.
### What did you see instead?
no exception occurs, ledger log send to obs file success, but actually when send part file sucess once, code throw exception lead to delete uploaded file in catch exception code.
### Anything else?
_No response_
### Are you willing to submit a PR?
- [X] I'm willing to submit a PR!
--
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-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] ZHr-UChiHa commented on issue #18536: [Bug] pulsar offload to S3 service failed, because BlobStoreManagedLedgerOffloader#offload close BlockAwareSegmentInputStream twice and throw exception.
Posted by GitBox <gi...@apache.org>.
ZHr-UChiHa commented on issue #18536:
URL: https://github.com/apache/pulsar/issues/18536#issuecomment-1320836285


if wireLog.isDebugEnabled() == true, wire.output(request) will also close BlockAwareSegmentInputStream, so blockStream closed Three times, the thrid time will throw exception. If disable debug log, offload function will run well.
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] github-actions[bot] commented on issue #18536: [Bug] enable debug log lead to pulsar offload to S3 service failed, because BlobStoreManagedLedgerOffloader#offload close BlockAwareSegmentInputStream third times and throw exception.
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #18536:
URL: https://github.com/apache/pulsar/issues/18536#issuecomment-1358732457
The issue had no activity for 30 days, mark with Stale label.
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] ZHr-UChiHa closed issue #18536: [Bug] pulsar offload to S3 service failed, because BlobStoreManagedLedgerOffloader#offload close BlockAwareSegmentInputStream twice and throw exception.
Posted by GitBox <gi...@apache.org>.
ZHr-UChiHa closed issue #18536: [Bug] pulsar offload to S3 service failed, because BlobStoreManagedLedgerOffloader#offload close BlockAwareSegmentInputStream twice and throw exception.
URL: https://github.com/apache/pulsar/issues/18536
--
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-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org