DRD Stats — Group 16, Code 148
Returns four totals describing this RAIDA’s user directory: how many live records it holds, how many tombstones are still within retention, the newest write time, and the oldest account. Open read, no parameters. Sync clients use it to size progress bars before a get_changes (147) pull and to detect drift between RAIDAs; monitoring uses it as a cheap health probe.
Quick reference
| Command Group | 16 (DRD) |
| Command Code | 148 (0x94) |
| Server function | cmd_drd_stats in cmd_drd.c |
| Request body | Exactly 18 bytes: challenge(16) + terminator(2). No parameters. |
| Authentication | None — totals are public |
| Transport | UDP or TCP; the response always fits one datagram |
| Success response | Status 250 + 32-byte payload (four big-endian 64-bit values) |
Request body (18 bytes)
| Body offset | Size | Field | Description |
|---|---|---|---|
| 0–11 | 12 | Challenge random | Random bytes generated by the client. |
| 12–15 | 4 | Challenge CRC32 | Big-endian CRC32 of bytes 0–11. |
| 16–17 | 2 | Terminator | Fixed 3E 3E. The body must be exactly 18 bytes. |
Response (32 bytes)
+--------------+-----------------+----------------+----------------+
| record_count | tombstone_count | max_updated_at | min_created_at |
| 8 (BE) | 8 (BE) | 8 (BE) | 8 (BE) |
+--------------+-----------------+----------------+----------------+
offset 0 8 16 24
| Payload offset | Size | Field | Description |
|---|---|---|---|
| 0–7 | 8 | record_count | Number of live (non-tombstoned) user records on this RAIDA. |
| 8–15 | 8 | tombstone_count | Number of deleted records still within the 90-day tombstone retention window. These appear in the changes feed (mode 0 or 2) but never in get_user or search. |
| 16–23 | 8 | max_updated_at | Unix seconds of the newest write, live or tombstone. 0 if the directory is empty. A client whose shard cursors all reach this time is fully caught up. |
| 24–31 | 8 | min_created_at | Unix seconds of the oldest live account’s created_at. 0 if the directory is empty. |
All four values are unsigned big-endian 64-bit integers. The counts are exact at the moment of the query; they are not cached.
Status codes
| Decimal | Hex | Symbol | Meaning |
|---|---|---|---|
| 250 | 0xFA | STATUS_SUCCESS | Totals returned in the payload. |
| 16 | 0x10 | ERROR_INVALID_PACKET_LENGTH | Body is not exactly 18 bytes. |
| 36 | 0x24 | ERROR_EMPTY_REQUEST | Body missing. |
| 252 | 0xFC | ERROR_INTERNAL | Database failure. |
| 254 | 0xFE | ERROR_MEMORY_ALLOC | Server allocation failure. |
Common mistakes
Comparing counts across RAIDAs and expecting equality
Each RAIDA’s DRD is independent. A small difference in record_count usually means one server missed a post while offline. Large differences are the signal to run a repair sync with 147.
Using record_count as the number of 147 entries to expect
A mode-0 changes pull returns live records plus tombstones. Sum record_count and tombstone_count when sizing a full pull, or use mode 1 and record_count alone.