-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZBUG-4409: Missing Blobs on a restored account from backup with S3 storage #1698
base: develop
Are you sure you want to change the base?
Conversation
store/src/java/com/zimbra/cs/store/external/ExternalStoreManager.java
Outdated
Show resolved
Hide resolved
|
||
try { | ||
String locator = writeStreamToStore(pin, actualSize, mbox, volume.getId()); | ||
if (locator != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (locator != null) { | |
if (null != locator) { |
@@ -306,6 +321,21 @@ public StagedBlob stage(InputStream data, Mailbox mbox) | |||
return stage(data, -1, mbox); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of hard code value can we declare variable for -1 , because its confusing
if (supports(StoreFeature.RESUMABLE_UPLOAD) && blob instanceof ExternalUploadedBlob) { | ||
ZimbraLog.store.debug("blob already uploaded, just need to commit"); | ||
String locator = ((ExternalResumableUpload) this).finishUpload((ExternalUploadedBlob) blob); | ||
if (locator != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (locator != null) { | |
if (null != locator) { |
InputStream is = getContent(blob); | ||
try { | ||
StagedBlob staged = stage(is, blob.getRawSize(), mbox, volume); | ||
if (staged != null && staged.getLocator() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (staged != null && staged.getLocator() != null) { | |
if (null != staged && null != staged.getLocator()) { |
@@ -59,6 +60,11 @@ public StagedBlob stage(InputStream data, long actualSize, Mailbox mbox) throws | |||
return null; | |||
} | |||
|
|||
@Override | |||
public StagedBlob stage(InputStream data, long actualSize, Mailbox mbox, Volume volume) throws IOException, ServiceException { | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about NotImplementedException
or UnsupportedOperation
@Override | ||
public StagedBlob stage(InputStream data, long actualSize, Mailbox mbox, Volume volume) throws IOException, ServiceException { | ||
// mailbox store is on the same volume as incoming directory, so no need to stage the blob | ||
throw ServiceException.FAILURE("Operation can not be completed because ExternalStoreManager is not available", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary this method will be always executed for external storage, this message should be generic
Issue: With-Blob Backup was not supported for external storage.
Fix: Modified the Backup and Restore code to support with-blob backup. For external storage, blobs will be restored in the same bucket.