can you explain this pause during replication?

68 views
Skip to first unread message

Matteo Grolla

unread,
Jul 15, 2016, 5:33:31 AM7/15/16
to PouchDB
I'm trying to understand the reason for this behavious of pouchdb (v 5.4.5 but previous versions behaved the same)

using chrome:
initial replication from local couchdb lasts ~75s
first ~20s:
  I see a lot of requests being made and succeed
then it stops for ~50s
  no requests being made
last few seconds
   makes few more requests and completes replication

using 
PouchDB.debug.enable(*)

before the pause:
   pouchdb:api body-planet +6ms bulkDocs Object {docs: Array[79], new_edits: false}

after the pause I have:
   pouchdb:api body-planet +54s bulkDocs success []

the bulkdocs sends 79 docs and they all seems design like this (sampled a few)

first doc
  1. data:Object
    1. _deleted:true
    2. _doc_id_rev:"_design/idx-cebad2f4a10a02b86e1b10f9f7fd2271::589-e0e7a702aef12cda523e2dd6b356eb2b"
    3. __proto__:Object
  2. metadata:Object
    1. deleted:true
    2. id:"_design/idx-cebad2f4a10a02b86e1b10f9f7fd2271"
    3. rev_tree:Array[46]
    4. revisions:Object
      1. ids:Array[589]
      2. start:589
      3. __proto__:Object
    5. seq:4324
    6. winningRev:"589-e0e7a702aef12cda523e2dd6b356eb2b"
    7. __proto__:Object
  3. stemmedRevs:Array[0]
  4. __proto__:Object
79th doc
  1. Object
    1. _deleted:true
    2. _doc_id_rev:"_design/idx-cebad2f4a10a02b86e1b10f9f7fd2271::1821-64ad933ee09b372de8de2ce52257d577"
    3. __proto__:Object
  2. metadata:Object
    1. deleted:true
    2. id:"_design/idx-cebad2f4a10a02b86e1b10f9f7fd2271"
    3. rev_tree:Array[94]
    4. revisions:Object
      1. ids:Array[1821]
      2. start:1821
      3. __proto__:Object
    5. seq:4402
    6. winningRev:"1821-64ad933ee09b372de8de2ce52257d577"
    7. __proto__:Object
  3. stemmedRevs:Array[0]
  4. __proto__:Object

Can you explain me what is happening?



Matteo Grolla

unread,
Jul 15, 2016, 8:09:10 AM7/15/16
to PouchDB
I think I understood what's happening
I was using pouchdb-find, improperly. This made me recreate the index a lot of times, then I deleted all the revisions and stopped using pouchdb-find.
Now I'd like to definitely get rid of those documents.
What's the best way to do it?

Nolan Lawson

unread,
Aug 2, 2016, 11:20:23 PM8/2/16
to PouchDB
pouchdb-find has a deleteIndex() method that should be able to do that for you. Else you can also just erase the whole IndexedDB in Dev Tools -> Application -> "Clear storage."
Reply all
Reply to author
Forward
0 new messages