Cache: Received (unused sequence) Log on Sync Gateway


I’m seeing odd messages in the SG Log file with * logging.

“Cache: Received #… (unused sequence)”

What does this message mean?

Any info would be appreciated.


“Unused Sequences” backstory:

When Sync Gateway creates new Couchbase Server docs, it must allocate a unique, monotonically increasing sequence number for each document from a global sequence counter.

Sometimes, however, it will allocate a sequence but it will never end up being used. For example if it allocates sequence 63 while trying to save a doc with ID=foo, however another Sync Gateway writes a doc with the same ID in the meantime, the save operation will fail and sequence 63 will never be used.

When the “changes cache” (which stores a local cache of items on changes feeds) sees these unused sequences on the DCP feed, it will emit that log entry.

It looks harmless and would be expected to happen under normal usage.