-
Notifications
You must be signed in to change notification settings - Fork 84
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
Replication completely resets on timeout #39
Comments
Doesn't seem to be linked to the event listeners, but the 503 causes the replication to reset. I'm not sure if that's normal or not... More logs:
|
I think the reason the replication is resetting is because the target database is read-only. We have a longstanding issue where we need to write As for the EventEmitter warning, that's definitely a bug that I thought we had fixed awhile ago. Filed: pouchdb/pouchdb#4093 |
If the database is read only then we should fallback to just relying on the local checkpoint (https://github.com/pouchdb/pouchdb/blob/master/lib/replicate/checkpointer.js#L101) as long as the error we get back is as expected, is that changing somehow? |
There's definitely something super wrong. I left local-npm running and it go to 100%, then when restarting and catching up with changes it randomly drops back down to zero:
|
Based on the output it seems like you are not using the latest version. Could you update to 1.4.2 and try again? |
Oh shoot my bad, excuse me. I opened a PR and then never merged it. I'll publish 1.4.3 right now. |
Should be fixed by #41, please reopen if it's not. |
Sorted. I've seen all of the view docs in pouch, is it possible to query this local-npm using those desig docs? i.e. find all the modules that depend on semver for instance? |
Yeah, that's actually a really neat idea. In the Fauxton UI (http://localhost:16984/_utils) I can see a ton of secondary indexes that are already in that As a test, I did this: curl http://localhost:16984/skimdb/_design/by_maintainer -X PUT -H 'Content-Type: application/json' --data-binary '{"_id":"_design/by_maintainer","views":{"by_maintainer":{"map":"function (doc) {\n if (doc.maintainers) {\n for (var i = 0; i < doc.maintainers.length; i++) {\n var email = doc.maintainers[i].email;\n if (email) {\n emit(email); \n }\n }\n }\n}"}},"language":"javascript"}'
curl 'http://localhost:16984/skimdb/_design/by_maintainer/_view/by_maintainer?key=%22nolan@nolanlawson.com%22&limit=5' The secondary index is slow to build, but it works! Prints out: {"total_rows":203396,"offset":0,"rows":[{"key":"nolan@nolanlawson.com","id":"add-cors-to-couchdb","value":null},{"key":"nolan@nolanlawson.com","id":"blob-util","value":null},{"key":"nolan@nolanlawson.com","id":"chord-magic","value":null},{"key":"nolan@nolanlawson.com","id":"couchdb-harness","value":null},{"key":"nolan@nolanlawson.com","id":"debug-websql","value":null}]} For querying modules that depend on semver, I guess you would need to emit all dependency versions or maybe just emit if any version numbers start with a ^ or a ~. The Fauxton UI is actually pretty nice for editing these kinds of ddocs; highly recommended. |
It seems to have reset after around 7%...
The text was updated successfully, but these errors were encountered: