-
Notifications
You must be signed in to change notification settings - Fork 33
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
Handoff to regular replication does not work? #39
Comments
Found the error! |
That doesn't sound right. You shouldn't need to do that. I'm going to reopen this issue because it sounds like we have a regression. |
I can't easily reproduce this. @nicozimmermann94 is the database that you're generating the dump from the same one you're syncing to (exactly the same URL)? |
@willholley Yes it was the exact same URL. |
@nicozimmermann94 I attempted to reproduce this using the code you posted and a local CouchDB 1.6.1 instance (via the proxy you posted). I still don't see a problem with handoff. Are you able to share a HAR / network trace of the issue occurring? |
Yes exactly the same setup for me and adding |
Just went through this; what seems to happen is that it has to write the remote checkpoint for every change, so when loading 50K documents it has to make tens of thousands of requests. It's all just requests to _local/[random id] and _changes. It's not actually trying to do redo any documents/changes, just writing the remote checkpoint thousands of times. Seems like this could be solved by only putting the latest checkpoint once and stopping there, instead of starting from scratching and adding checkpoints one by one. I figured that's what The That is a perfect workaround for me, but it seems like proxy could handle it by itself. If this is something @nolanlawson is interested in resolving, I'd love a chance to go in, sort it out, and come up with a PR for it. |
@BrunoDEBARROS a checkpoint for every change sounds wrong - the What environment are you syncing against and how are you initiating the load/sync? |
If you add the It's just that without the Having said that, here's the requested info: To create the dump, I just To load it on the browser, I just do: db = new PouchDB('my_db');
db.load("https://example.com/dump.txt", {proxy: "https://couchdb.example.com/my_db"}) The CouchDB server itself is hidden behind nginx, following these instructions. |
thanks @BrunoDEBARROS. So it's possible that the checkpoint being written to CouchDB is incorrect / not being picked up. The other point to make is that the handoff only valid for |
In my code I do db.sync(remote), not remote.sync(db), so after reading your message, I swapped them around to see if it'd work, and I'm afraid the issue is still there. If this doesn't seem worth chasing, it doesn't matter; the |
@BrunoDEBARROS the issue is |
That makes perfect sense, and also explains why myself and the other posters were having problems; we're all doing sync (OP says they're doing sync and even includes source code) and stumbled across this. Regarding Thanks for helping figure out what's going on though! 👍 Seems like this is just a matter of updating the documentation then, since it doesn't mention anything but |
If I use the since parameter in |
Ok, I found two issues:
suggestion: the pouchdb load should also write the |
is there any update regarding this issue? |
Hey!
I have a remote db with 50,000 docs. When the user starts the webapp for the first time he has to download all docs, so I use pouchdb-load together with express-pouchdb-replication-stream to deliver the stream. The import works but after importing and then enable syncing, pouchdb makes 2000+ requests which takes several minutes. I guess it checks each document, so the proxy function does not work as intended. Here is my code:
http://pastebin.com/GciHNH8u
And here is the sync function:
http://pastebin.com/B2s65X9k
The text was updated successfully, but these errors were encountered: