Skip to content

TRANSACTION SLOW

Returns the slow transactions logged by this member.

TRANSACTION SLOW

SLOW takes no arguments.

An array with one map per logged transaction, newest first. On RESP2 each map is a flat array of keys and values.

FieldTypeDescription
idintegerTransaction id, unique on this member
timestampintegerUnix time in milliseconds when the transaction was closed
duration_msintegerMilliseconds from creation to close
commit_latency_msintegerMilliseconds spent in commit, 0 when the transaction was not committed
client_idintegerClient id of the session that owned the transaction, -1 for internal
namespacestring or nullNamespace of the command
bucketstring or nullBucket of the command, null when the command has no bucket
modelstring or nullData model of the command: Bucket or ZMap, null for others
commandstring or nullName of the command
querystring or nullBQL query of the command, every value replaced by ?
committedbooleanTrue when the transaction was committed
conflictedbooleanTrue when the commit failed with a conflict
readsintegerPoint reads
range_readsintegerRange reads
writesintegerWrites
deletesintegerDeletes
range_deletesintegerRange deletes
mutationsintegerAtomic mutations
bytes_readintegerBytes read
bytes_writtenintegerBytes written

A transaction is logged when it is closed and its duration is at least transaction.slow_log.threshold milliseconds. The log keeps the last transaction.slow_log.max_entries entries in memory. The oldest entry is dropped first. The log is not written to disk. A restart clears it.

The log covers only this member, not the cluster.

A transaction that holds a watch is not logged. It stays open until the watched key changes, so its duration is not useful.

Each entry shows the command that used the transaction. For a BEGIN block, this is the last command of the block. Internal transactions have client_id -1 and no command. For them namespace, bucket, model, command and query are null.

Command arguments and keys are not stored. query shows only the structure of the query. Every value is replaced by ?.

> TRANSACTION SLOW
1) 1# "id" => (integer) 42
2# "timestamp" => (integer) 1791964800000
3# "duration_ms" => (integer) 1850
4# "commit_latency_ms" => (integer) 12
5# "client_id" => (integer) 7
6# "namespace" => "global"
7# "bucket" => "users"
8# "model" => "Bucket"
9# "command" => "BUCKET.QUERY"
10# "query" => "{\"age\": {\"$gt\": ?}}"
11# "committed" => (true)
12# "conflicted" => (false)
13# "reads" => (integer) 3
14# "range_reads" => (integer) 1
15# "writes" => (integer) 0
16# "deletes" => (integer) 0
17# "range_deletes" => (integer) 0
18# "mutations" => (integer) 0
19# "bytes_read" => (integer) 512
20# "bytes_written" => (integer) 0