Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
use shard suffix when generating _changes ETag
In CouchDB 2.0, instance_start_time is always 0.
This means that when generating ETag values derived
from the database info object, the same ETags can be
incorrectly deemed valid between different database
instances with the metadata.

To avoid this we can incorporate the unique shard
suffix for the database instance when generating
the current ETag value.

Copied from fix by Will Holley in chttpd

  • Loading branch information
rnewson committed Sep 2, 2016
1 parent f7e43f5 commit 68c6a0eb43e52ba2c867a6f0c8318fa98c3f053f
Showing 1 changed file with 2 additions and 1 deletion.
@@ -53,7 +53,8 @@ handle_global_changes_req(#httpd{method='GET'}=Req) ->
case Feed of
"normal" ->
{ok, Info} = fabric:get_db_info(Db),
Etag = chttpd:make_etag(Info),
Suffix = mem3:shard_suffix(Db),
Etag = chttpd:make_etag({Info, Suffix}),
chttpd:etag_respond(Req, Etag, fun() ->
fabric:changes(Db, fun changes_callback/2, Acc#acc{etag=Etag}, Options1)

0 comments on commit 68c6a0e

Please sign in to comment.