You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/07/04 08:23:14 UTC

[GitHub] wohali commented on issue #1422: GET/ {db} request returns the structured response but instance_start_time has value "0"

wohali commented on issue #1422: GET/ {db} request returns the structured response but instance_start_time has value "0"
URL: https://github.com/apache/couchdb/issues/1422#issuecomment-402403200
 
 
   This is a documentation error, and relates to clustering.
   
   TL;DR: We don't recommend you rely on this value for anything in CouchDB 2.x or later versions. If you need to store when a database is created, create a document inside the database that includes that information at the time you create a database yourself.
   
   The reason this information is not available on the clustered interface is that, for a default CouchDB cluster setup of 3 nodes with q=8, there are 24 database shards for any given database, each of which has its own instance_start_time.
   
   There is currently no way to get each shard's instance start time through the clustered interface. However, on each node via localhost through the node-local (port 5986), you can get the instance_start_time per shard:
   
   ```
    $ curl http://localhost:5986/shards%2F00000000-1fffffff%2Fabc.1530133574
   {"db_name":"shards/00000000-1fffffff/abc.1530133574","engine":"couch_bt_engine","doc_count":127,"doc_del_count":0,"update_seq":127,"purge_seq":0,"compact_running":false,"sizes":{"active":31925,"external":3544,"file":90308},"disk_size":90308,"data_size":31925,"other":{"data_size":3544},"instance_start_time":"1530692235563311","disk_format_version":6,"committed_update_seq":127,"compacted_seq":127,"uuid":"953768671309b22f6bf8a5eae62f94a4"}
   ```
   
   Note again that this value will be different across multiple shards in the same database, as well as across multiple nodes in the same cluster. Only for a q=1 database in a single standalone server will you have a single instance_start_time value, which can and will change after database compaction (which occurs automatically by default.)
   
   **DO NOT USE PORT 5986 FOR REGULAR DATABASE OPERATIONS**. This interface is deprecated in 2.x and will be removed entirely in 3.x. By that time there will be replacements for all potential needs on the clustered interface.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services