janl commented on issue #1434: Views now retain update_seq after compaction.
URL: https://github.com/apache/couchdb/pull/1434#issuecomment-404809633
 
 
   Repro-script for your convenience.
   
   ```shell
   #!/bin/sh -x
   
   S=http://a:[email protected]:15984
   P=http://a:[email protected]:15986
   DB=x884
   
   
   curl -X PUT $S/_node/_local/_config/cluster/q -d '"1"'
   # delete test db
   curl -X DELETE $S/$DB
   
   # create test d
   curl -X PUT $S/$DB
   
   # create ddoc
   curl -X PUT $S/$DB/_design%2fddoc -d '{"language":"javascript","views":{"a": 
{"map": "function(doc) {emit(doc.a)}"}}}'
   
   # create docs
   curl -X PUT $S/$DB/doc1 -d '{"a":1}'
   curl -X PUT $S/$DB/doc2 -d '{"a":2}'
   
   # query view with seq
   
   curl $S/$DB/_design/ddoc/_view/a?update_seq=true
   
   # compact view
   SHARDS=`curl -s  http://a:[email protected]:15986/_all_dbs | jq '.' | grep $DB | 
sed -e 's/\//%2f/g' | sed -e 's/[\,\"\ ]//g'`
   for SHARD in $SHARDS; do
       curl -X POST -Hcontent-type:application/json  
http://a:[email protected]:15986/$SHARD/_compact/ddoc -d '{}'
   done
   
   # query view with seq
   curl $S/$DB/_design/ddoc/_view/a?update_seq=true
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to