couchbase-lite-java-ce-root icon indicating copy to clipboard operation
couchbase-lite-java-ce-root copied to clipboard

Trying to run multiple replicators in parellel to speed up the download resulting in “database is locked” error for about 10% of the insertions

Open ChauhanAbhishek opened this issue 2 years ago • 0 comments

In our usecase we have around 3 millions db rows to download which takes around 2 hours which is a bit unacceptable in our usecase. So to speed up the process we decided to run Multiple replicators in parellel but that leads to about 10% of the inserts failing with the following message.

{N8litecore4repl8InserterE#42} Failed to insert ‘781346ec-60a7-4edb-b4fc-ff9baxe7f68c’ #1-x345ascf8f3f4e3c3e3cf97fe1b20493abd5e : LiteCore Busy, “database busy/locked”

Looks like when a thread is writing to the DB then other threads are unable to write. But the thread which failed to write instead of either waiting or reattempting the insertion, it just moves on to the next row

ChauhanAbhishek avatar May 20 '23 05:05 ChauhanAbhishek