-
Notifications
You must be signed in to change notification settings - Fork 298
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
1 GB Push replication with attachment fails #328
Comments
More details please. Are you sure your test code is checking errors? |
Re-post with better formatting:
I also added printf in sync_gateway code to get more details about the error:
I tried it with attachment size of 20M. The result doc_size is 2000009, which reuslt in the following error regarding tap feed, but from the client side, there is no error. Should the client get error in this situation?
|
@lichenyang2 thanks that's much easier on the eyes. Btw I deleted your previous post (and you can also edit posts) |
Li: You need to run this test with walrus. Your logs show you ran it with Couchbase Server, where the max attachment (or doc) size is 20MB. Please re-run with walrus. |
Doc with 1G attachment does fail with Walrus, with error in Walrus log as following. However, there is no error seen on Xcode console. Query on Walrus db shows that there is no document created.
I did binary search for the size of document that would fail the same way. The result is that size of 537000000 would fail, but size of 536000000 is ok. |
I don't understand why this is failing or why it would start to fail at a magic size around 537MB; I'm guessing it's possibly a bug in the MIME parsing code in Go. Regardless, since we don't currently support storing attachments over 20MB, this isn't important to investigate. We can save it for the future after we add large-attachment support. |
Pasin says he found that pushing a doc with a huge attachment (too big to fit in memory) would fail (or crash?) when running on a real iOS device. From the backtrace it looks as though the attachment gets loaded into RAM and expanded into base64 — that shouldn't be happening, its metadata should have a |
I think I have a little bit old code that doesn't have 503f000 commit. Let me retest it. |
Still has the same problem. The attachment is always expanded. I tried to follow the codes and found that the following block returns stub attachment dictionary even though the follow attribute is YES but changing that part of code alone doesn't work (leading to a new issue that doc doesn't get store). https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/CBLDatabase%2BAttachments.m#L345 |
Yes, I think this has been broken for at least a few months. The attachment related code has gone through changes twice lately — once for ForestDB and again to support streaming. I think I broke this in one of those. |
Edit the value of "kSizeofAttachment" to 1 GB in the script https://github.com/couchbaselabs/iOS-WorkerBee/blob/third_installment/Tests/Test13_PushReplicateWithAttachment.m and execute it.
Please configure the sync gateway to use in memory walrus database. The test displays the replication is complete but there is no document found on Sync Gateway
The text was updated successfully, but these errors were encountered: