Why do I see several missing GET calls to {somedb}/_local/{someweirdID} in the sync_gateway logs

30 views
Skip to first unread message

Martin Palatnik

unread,
Sep 17, 2014, 9:48:53 AM9/17/14
to mobile-c...@googlegroups.com
Hi,

Thanks for making such wonderful product and answering all the questions in the forum.

Although my code is working as expected I'm having some issues to understand some information I'm seeing in the logs: There are a bunch of GET calls to {db}/_local/{someweirdID} that I don't understand. Below is an extract from the log. 

10:40:16.673753 HTTP:  #011: GET /nearup/_local/ec27d0ac0d1009f8ee0d0c3ac9210fece6249475  (as avEhFiUL_H)

10:40:16.673903 HTTP: #011:     --> 404 missing  (0.5 ms)

10:40:16.678071 HTTP:  #012: POST /nearup/_changes  (as avEhFiUL_H)

10:40:16.684517 HTTP:  #013: PUT /nearup/_local/ec27d0ac0d1009f8ee0d0c3ac9210fece6249475  (as avEhFiUL_H)

10:40:16.778297 HTTP:  #014: GET /nearup/_local/64eb794ad5b4e9499b8047733be832f5db11561e  (as avEhFiUL_H)

10:40:16.778641 HTTP: #014:     --> 404 missing  (1.5 ms)

10:40:16.781393 HTTP:  #015: GET /nearup/_local/2154e49ca804e809034c779acf309f24d2eb1e5b  (as avEhFiUL_H)

I keep on getting this even after flushing the database, deleting the app and restarting sync_gateway.
Why is that? If I understood correctly from the docs _local is to store device specific data.
Is sync_gateway maintaining some kind of cache that persists even when I flush the couchbase bucket? 
Can you please help me to understand what are those GET and PUT to _local and why some of the GET are always missing? 

Thanks a lot!

Martin

Jens Alfke

unread,
Sep 17, 2014, 11:50:32 AM9/17/14
to mobile-c...@googlegroups.com

On Sep 17, 2014, at 6:48 AM, Martin Palatnik <mar...@gmail.com> wrote:

Although my code is working as expected I'm having some issues to understand some information I'm seeing in the logs: There are a bunch of GET calls to {db}/_local/{someweirdID} that I don't understand. Below is an extract from the log. 

Those are replication checkpoints. They're managed by the CBL replicator. Just ignore them. Or if you want to know more, read about the replication algorithm.

—Jens

Zack Gramana

unread,
Sep 17, 2014, 11:54:17 AM9/17/14
to <mobile-couchbase@googlegroups.com>
These are checkpoint docs that CBL uses to "bookmark" the last sequence id it sync'ed.

You will always see the 404 when doing your first sync after deleting a database. The id is an SHA hash, so CBL can compute the checkpoint doc's id without having to look anything up. Saving it to _local keeps it from getting replicated.

On Sep 17, 2014, at 6:48 AM, "Martin Palatnik" <mar...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/b298c6e0-9285-44c3-bd36-d47cd697b4fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
Sep 17, 2014, 12:23:50 PM9/17/14
to mobile-c...@googlegroups.com

On Sep 17, 2014, at 8:54 AM, Zack Gramana <za...@couchbase.com> wrote:

You will always see the 404 when doing your first sync after deleting a database. The id is an SHA hash, so CBL can compute the checkpoint doc's id without having to look anything up. Saving it to _local keeps it from getting replicated.

A 404 will also occur the first time you run a replication with a different configuration, i.e. a new filter or filter params or explicit set of doc-IDs.

—Jens
Reply all
Reply to author
Forward
0 new messages