Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the "h" in oplog.rs document stand for?

Tags:

mongodb

As in here:

{
    "ts" : Timestamp(1374832131, 1),
    "h" : NumberLong("-1336944105039123379"),
    "v" : 2,
    "op" : "i",
    "ns" : "users.users",
    "o" : {
            "_id" : ObjectId("51f24603d98de3716b1db672")
    }
}

Thanks

like image 612
Ori Dar Avatar asked Jul 26 '13 10:07

Ori Dar


People also ask

What is Oplog?

The oplog (operations log) is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases.

What is local Oplog RS?

local.oplog.rs is the capped collection that holds the oplog. You set its size at creation using the oplogSizeMB setting. To resize the oplog after replica set initiation, use the Change the Size of the Oplog procedure. For additional information, see the Oplog Size section.

What is replication Oplog?

Replication Oplog Window is (X) occurs if the approximate amount of time available in the primary replication oplog meets or goes below the specified threshold. This refers to the amount of time that the primary can continue logging given the current rate at which oplog data is generated.

What does the TS provide in Oplog stores in MongoDB?

It means the application server will be notified real-time of any changes happening in the entire database.


1 Answers

  1. ts: the time this operation occurred.
  2. h: a unique ID for this operation. Each operation will have a different value in this field.
  3. op: the write operation that should be applied to the slave. n indicates a no-op, this is just an informational message.
  4. ns: the database and collection affected by this operation. Since this is a no-op, this field is left blank.
  5. o: the actual document representing the op. Since this is a no-op, this field is pretty useless.

Reference: Replication Internals

like image 164
Andrei Sfat Avatar answered Oct 20 '22 23:10

Andrei Sfat