ArangoDB v4.x is under development and not released yet.
This documentation is not final and potentially incomplete.
Replication logger commands of the HTTP API
The replication logger commands let you query the logger state and incrementally fetch the latest changes from the write-ahead log
All data-modification operations are written to the server’s write-ahead log and are not handled by a separate replication logger.
You can query the current state of the logger and fetch the latest changes
written by the logger with the logger-state method. The operations return the
state and data from the write-ahead log.
To query the “recent” operations from the write-ahead log, the HTTP interface
also provides the /_api/wal/tail endpoint. It should be used by
replication clients to incrementally fetch updates from the server.
Get the replication logger state
Returns the current state of the server’s replication logger. The state will include information about whether the logger is running and about the last logged tick value. This tick value is important for incremental fetching of data.
The body of the response contains a JSON object with the following attributes:
state: the current logger state as a JSON object with the following sub-attributes:running: whether or not the logger is runninglastLogTick: the tick value of the latest tick the logger has logged. This value can be used for incremental fetching of log data.totalEvents: total number of events logged since the server was started. The value is not reset between multiple stops and re-starts of the logger.time: the current date and time on the logger server
server: a JSON object with the following sub-attributes:version: the logger server’s versionserverId: the logger server’s id
clients: returns the last fetch status by replication clients connected to the logger. Each client is returned as a JSON object with the following attributes:syncerId: id of the client syncerserverId: server id of clientlastServedTick: last tick value served to this client via the WAL tailing APItime: date and time when this client last called the WAL tailing API
Examples
Returns the state of the replication logger.
curl --header 'accept: application/json' --dump - http://localhost:8529/_api/replication/logger-stateShow output
HTTP/1.1 200 OK
content-type: application/json
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
connection: Keep-Alive
content-length: 242
content-security-policy: frame-ancestors 'self'; form-action 'self';
expires: 0
pragma: no-cache
server: ArangoDB
strict-transport-security: max-age=31536000 ; includeSubDomains
x-arango-queue-time-seconds: 0.000000
x-content-type-options: nosniff
{
"state" : {
"running" : true,
"lastLogTick" : "181149",
"lastUncommittedLogTick" : "181149",
"totalEvents" : 181149,
"time" : "2024-03-11T19:04:19Z"
},
"server" : {
"version" : "3.12.0-nightly.20240305",
"serverId" : "139702625518696",
"engine" : "rocksdb"
},
"clients" : [ ]
}