Skip to content

Commit bf0050f

Browse files
author
Sam Kleinman
committed
merge: DOCS-771
2 parents 03ce5a1 + 322158a commit bf0050f

File tree

2 files changed

+99
-3
lines changed

2 files changed

+99
-3
lines changed

source/core/sharding-internals.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ In general, you should *never* manipulate the content of the config
556556
database directly. The ``config`` database contains the following
557557
collections:
558558

559+
- :data:`changelog`
559560
- :data:`chunks`
560561
- :data:`collections`
561562
- :data:`databases`
@@ -592,14 +593,14 @@ When sharding a :term:`GridFS` store, consider the following:
592593

593594
db.fs.chunks.ensureIndex( { files_id : 1 , n : 1 } )
594595

595-
db.runCommand( { shardcollection : "test.fs.chunks" , key : { files_id : 1 , n : 1 } } )
596+
db.runCommand( { shardCollection : "test.fs.chunks" , key : { files_id : 1 , n : 1 } } )
596597

597598
You may also want shard using just the ``file_id`` field, as in the
598599
following operation:
599600

600601
.. code-block:: javascript
601602

602-
db.runCommand( { shardcollection : "test.fs.chunks" , key : { files_id : 1 } } )
603+
db.runCommand( { shardCollection : "test.fs.chunks" , key : { files_id : 1 } } )
603604

604605
.. note::
605606

source/reference/config-database.txt

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,101 @@ Collections
3232
.. if we add a collection to the config database here, also update the
3333
list on the sharding-internals page.
3434

35+
.. data:: changelog
36+
37+
The :data:`changelog` collection stores a document for each change to
38+
the metadata of a sharded collection.
39+
40+
Each document contains the following fields:
41+
42+
.. data:: changeID
43+
44+
hostname-time-increment
45+
46+
.. data:: server
47+
48+
hostname
49+
50+
.. data:: clientAddr
51+
52+
hostname:port of client causing change
53+
54+
.. data:: time
55+
56+
time change occurred
57+
58+
.. data:: what
59+
60+
Type of change:
61+
62+
* dropCollection
63+
* dropCollection.start
64+
* dropDatabase
65+
* dropDatabase.start
66+
* moveChunk.start
67+
* moveChunk.commit
68+
* split
69+
* multi-split
70+
71+
.. data:: ns
72+
73+
Namespace change affected.
74+
75+
.. data:: details
76+
77+
A BSON document of additional details, the contents vary
78+
depending on the type of the change.
79+
80+
81+
.. example::
82+
83+
The following example displays a single record of a chunk split
84+
from a ``config.changelog`` collection:
85+
86+
.. code-block:: javascript
87+
88+
{
89+
"_id" : "d.local-2012-12-11T14:09:21-0",
90+
"server" : "d.local",
91+
"clientAddr" : "127.0.0.1:63381",
92+
"time" : ISODate("2012-12-11T14:09:21.039Z"),
93+
"what" : "split",
94+
"ns" : "snps.elegans",
95+
"details" : {
96+
"before" : {
97+
"min" : {
98+
"snp" : { $minKey : 1 }
99+
},
100+
"max" : {
101+
"snp" : { $maxKey : 1 }
102+
},
103+
"lastmod" : Timestamp(1000, 0),
104+
"lastmodEpoch" : ObjectId("000000000000000000000000")
105+
},
106+
"left" : {
107+
"min" : {
108+
"snp" : { $minKey : 1 }
109+
},
110+
"max" : {
111+
"snp" : "haw54524"
112+
},
113+
"lastmod" : Timestamp(1000, 1),
114+
"lastmodEpoch" : ObjectId("50c73e0bca6554d8d3b19a83")
115+
},
116+
"right" : {
117+
"min" : {
118+
"snp" : "haw54524"
119+
},
120+
"max" : {
121+
"snp" : { $maxKey : 1 }
122+
},
123+
"lastmod" : Timestamp(1000, 2),
124+
"lastmodEpoch" : ObjectId("50c73e0bca6554d8d3b19a83")
125+
}
126+
}
127+
}
128+
129+
35130
.. data:: chunks
36131

37132
The :data:`chunks` collection stores a document for each chunk in
@@ -187,7 +282,7 @@ Collections
187282
mongos> db.getCollection("version").find()
188283
{ "_id" : 1, "version" : 3 }
189284

190-
.. note::
285+
.. note::
191286

192287
Like all databases in MongoDB, the ``config`` database contains a
193288
:data:`system.indexes` collection contains metadata for all indexes

0 commit comments

Comments
 (0)