Arango logo

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

GET http://<EXTERNAL_ENDPOINT>:8529/_arango/v1/_db/:database-name/_api/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 running

    • lastLogTick: 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 version

    • serverId: 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 syncer

    • serverId: server id of client

    • lastServedTick: last tick value served to this client via the WAL tailing API

    • time: date and time when this client last called the WAL tailing API

Path Parameters
  • The name of the database.

    Example: _system

Query Parameters
    HTTP Headers
      Responses
      • is returned if the logger state could be determined successfully.

      • is returned when an invalid HTTP method is used.

      • is returned if the logger state could not be determined.

      Examples

      Returns the state of the replication logger.

      curl --header 'accept: application/json' --dump - http://localhost:8529/_api/replication/logger-state
      Show 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" : [ ] 
      }