wohali commented on issue #984: update_seq of a view is set to zero after 
compaction
URL: https://github.com/apache/couchdb/issues/984#issuecomment-343757399
 
 
   Functionality was added back into 2.x with this commit:
   
   
https://github.com/apache/couchdb/commit/dc5cca804132266edec7a62cb2ca6b36cfadab27
   
   by @rnewson .
   
   This test validates that the update_seq is preserved across a compaction 
through the use of `GET /{db}/{ddoc}/_info`:
   
   
https://github.com/apache/couchdb/blob/master/test/javascript/tests/view_compaction.js
   
   A worked example from the original poster. Note that `GET 
/{db}/{ddoc}/_info` returns the correct `update_seq` value, less the encoded 
cluster state, and that after a subsequent PUT to the database, the view's 
`update_seq` is still out of sync with the `GET /{db}/{ddoc}/_info` value:
   
   ```bash
   $ curl -s 
http://localhost:5984/skimdb/_design/byName/_view/new-view?update_seq=true | 
head -1
   
{"total_rows":27371,"offset":0,"update_seq":"27385-g1AAAAC3eJzLYWBgYMlgTmEQTM4vTc5ISXIwNDLXMwBCwxygFFOSA5BMqv___39WEgODVCYepXksQJLhAJD6D1UuHYVHeSJDkj3M2AkEjW2AGLsfrHxZFgBRADIY","rows":[
   
   $ curl -s http://localhost:5984/skimdb/_design/byName/_info
   
{"name":"byName","view_index":{"updates_pending":{"minimum":0,"preferred":0,"total":0},"waiting_commit":false,"waiting_clients":0,"updater_running":false,"update_seq":27385,"sizes":{"file":20550176,"external":784774,"active":1567075},"signature":"e6a4d6491aa0b877b4c15653f5fc27c3","purge_seq":0,"language":"javascript","disk_size":20550176,"data_size":784774,"compact_running":false}}
   
   $ curl -X POST -H "Content-type: application/json" 
http://localhost:5984/skimdb/_compact/byName
   {"ok":true}
   
   $ curl -s 
http://localhost:5984/skimdb/_design/byName/_view/new-view?update_seq=true | 
head -1
   
{"total_rows":27371,"offset":0,"update_seq":"0-g1AAAACreJzLYWBgYMlgTmEQTM4vTc5ISXIwNDLXMwBCwxygFFMeC5BkaABS____35-VyEBQ7QGI2v_41SY5A
   MmkeoLqEhmS7CGKsgANHi-y","rows":[
   
   $ curl -s http://localhost:5984/skimdb/_design/byName/_info
   
{"name":"byName","view_index":{"updates_pending":{"minimum":0,"preferred":0,"total":0},"waiting_commit":false,"waiting_clients":0,"updater_running":false,"update_seq":27385,"sizes":{"file":1331732,"external":782314,"active":1449787},"signature":"e6a4d6491aa0b877b4c15653f5fc27c3","purge_seq":0,"language":"javascript","disk_size":1331732,"data_size":782314,"compact_running":false}}
   
   $ curl -X PUT http://localhost:5984/skimdb/foo2 -d '{}'
   {"ok":true,"id":"foo2","rev":"1-967a00dff5e02add41819138abb3284d"}
   
   $ curl -s 
http://localhost:5984/skimdb/_design/byName/_view/new-view?update_seq=true | 
head -1
   
{"total_rows":27372,"offset":0,"update_seq":"6762-g1AAAACueJzLYWBgYMlgTmEQTM4vTc5ISXIwNDLXMwBCwxygFFOSA5BMqv___39WEgODVBYepXksQJLhAJD6D1KeyIBHbSJDkj1BRRADGyAG7geqzQIAwGowNw","rows":[
   
   $ curl -s http://localhost:5984/skimdb/_design/byName/_info
   
{"name":"byName","view_index":{"updates_pending":{"minimum":0,"preferred":0,"total":0},"waiting_commit":true,"waiting_clients":0,"updater_running":false,"update_seq":27386,"sizes":{"file":1333905,"external":782327,"active":1449906},"signature":"e6a4d6491aa0b877b4c15653f5fc27c3","purge_seq":0,"language":"javascript","disk_size":1333905,"data_size":782327,"compact_running":false}}
   ```

----------------------------------------------------------------
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