Skip to content

Runbooks

Each Prometheus alert also has an entry in the alert runbook.

First response

Do these checks before you restart processes or retry writes.

  1. Process or backend? Compare /livez and /readyz. If /livez is 200 and /readyz is 503, read the readiness response body. The probe checks run in this order: draining, then backend.
  2. One process or all? If the response says foundationdb unreachable, run fdbcli --exec "status minimal" from an affected host with the same cluster file. Compare the file, client library, configuration, clock and network with a healthy host. A fleet-wide 503 alone does not prove a FoundationDB outage. A drain skips the backend check.
  3. Protect unknown writes. Search the logs for The write may or may not have been applied. Do not blindly repeat increments or other read-modify-write updates. See unknown write outcomes.
  4. Saturation. Check latency and errors per action, then FoundationDB queues, disk space and conflicts. See a process is at its limit. Sustained fdyno_transaction_fdb_errors_total{code="1213"} or {code="1051"} means FoundationDB throttles fdyno.
  5. Background work. Check the worker's last lease-held pass and progress, not only its owner gauge. See a worker falls behind.
  6. Data integrity. After a non-zero fdyno_index_divergence_total, run dynodb verify.

Recover from a disk I/O timeout

FoundationDB can log io_timeout (1521) and exit fdbserver after a disk stall. With a 20-second io_trust_seconds setting, a blocked I/O can time out after about 20 seconds. That is not a recovery deadline.

  1. Check the FoundationDB logs and the affected disk. Preserve the traces.
  2. Restore disk I/O. Make sure fdbmonitor supervises and restarts the exited fdbserver. Fix the supervisor if it did not restart the process. Restarting fdyno does not restart FoundationDB.
  3. Check fdbcli --exec "status minimal" with the same cluster file. Check fdyno's /readyz before restoring traffic. Apply the unknown write procedure before retrying interrupted writes.

Find the steps for a symptom

Each row links to the section with the steps. Check the cause there before you act.

Symptom Likely cause Check and act
A write returns HTTP 500 The write may or may not have been applied A timeout or lost response can hide a committed write Unknown write outcomes
A write returns ProvisionedThroughputExceededException with TableWriteKeyRangeThroughputExceeded A hot-item queue wait would miss the deadline, or FoundationDB conflicts exhausted the write's retry budget Check: Read ThrottlingReasons and look for concurrent writes to the same item. Act: Back off and reduce concurrent writes to that item. See Hot items and hot partitions.
BatchWriteItem returns ProvisionedThroughputExceededException The batch was throttled before it wrote anything; for a batch split into chunks, every chunk was Batches
A restore stays CREATING The restore is unfinished; passes may be failing A restore stays CREATING
A failed import left a CREATING target, or reports TargetCleanupFailed Target cleanup reached five counted failures with the target still present Backup troubleshooting
A transaction replay or internal retry applied twice after a clock step or a host suspend A forward clock step made cleanup remove a token too early, or made the serving instance treat a stored token as expired; or a backward step on the writer left its token behind the cleanup clock; or the writer's host was suspended (for example a VM pause) while a commit outcome was unknown, for longer than 10 minutes minus DYNODB_OPERATION_TIMEOUT, so the token expired before the retry. A client retry late in its window can miss the token after a much shorter suspend. A write without a token is retried inside fdyno only when it is idempotent. Clock synchronization and the client procedure
fdyno_worker_lease_implausible_expiry_total{worker} rises A worker or job lease has an expiry far past this process's clock: the holder's clock is ahead, or this one is behind A lease expiry is implausibly far ahead
fdyno_ttl_drain_entries_skipped_total{table} rises A TTL drain cannot delete one expired row of that table, so it reads past the row each pass A TTL row is skipped
A new GSI stays CREATING The backfill is slow or not running A new index stays CREATING
On a table with many GSIs, fdyno_gsi_backlog_age_seconds{table} or GSI apply lag grows with the write rate, and the GSI applier has no errors The storage hosts' disks reach their write IOPS: with many GSIs, each write adds a lot of storage input. The GSI change log ends also put extra input on one storage team GSI lag grows on a GSI-heavy table
An export is FAILED with PublishOutcomeUnknown fdyno could not confirm the summary write; manifest-summary.json may exist Export to S3
An import is FAILED with ImportFailed and a listing error The S3 endpoint or a proxy returned an invalid listing Import from S3
FoundationDB logs io_timeout (1521) after a disk stall and fdbserver exits The blocked disk I/O timed out Recover from a disk I/O timeout
dynodb verify table <name> --ttl-index reports ttl_due_missing_entry above 0 A due row lacks its expected expiry-index entry after backfill. The count does not identify why. Check: Read Verify stored data to distinguish this count from ttl_due_pending_backfill; repeat with writes paused if the first check ran live. Act: For a confirmed missing-entry problem, follow the repair steps.
PITR overdue undo age grows across fresh lease-held passes Trim may not keep up; check reported work against the pass threshold PITR trim falling behind
A stream consumer stops receiving records Wrong ARN, LATEST position, or trimmed records Troubleshooting a consumer
Resuming with AT_TIMESTAMP from a returned record time replays records from the same second GetRecords rounds ApproximateCreationDateTime down to whole seconds; seeks can still use fractional timestamps Check: See whether the checkpoint uses that rounded field. Act: Resume after the last processed SequenceNumber with AFTER_SEQUENCE_NUMBER and follow shard lineage. See Stream API and iterator positions.
Requests fail with InvalidSignatureException Signature expired or Signature not yet current The client's request time is more than 15 minutes from that fdyno process's clock Check: Compare the request time with the server time the message gives. Act: Fix the client or server clock. See When a clock is off.
A reader of AWSDynamoDB/data/ picks up data files of a failed or unfinished export Incremental exports under one S3Prefix share that folder, and a failed export keeps its data files Check: Read only the files that manifest-files.json of a COMPLETED export lists. Act: Remove the failed export's objects. See What a partial export leaves.
dynodb migrate copy, import or catchup stops with items still unprocessed after a number of attempts More than 50 attempts in a row of one batch processed nothing Check: The target's throttling, capacity and log: UnprocessedItems can mean that a chunk failed for a reason other than throttling; fdyno knows those writes did not commit. Act: Resume from the checkpoint, with fewer --writers if the target is overloaded. See How the copy runs.
A process exits at startup with FoundationDB client library check failed The process starts only when its FoundationDB client is confirmed to talk to the cluster within 10 s: one read version. Either the library's version does not match the cluster's protocol (for example a 7.3 library after the cluster moved to 7.4), or the client could not reach the cluster Check: With cannot talk to the cluster the error names the library version, its protocol and the cluster's protocol: the versions do not match. With did not answer a read version, the client did not reach the cluster: check that it answers (fdbcli --exec status) through the same cluster file. Act: For a mismatch, install a libfdb_c of the cluster's version, or load one through FDB_NETWORK_OPTION_EXTERNAL_CLIENT_LIBRARY. For an unreachable cluster, restore it: a cluster that is down at start makes the process exit, and the supervisor restarts it until the cluster answers. See Configuration and shutdown and restarts.
A process exits at startup with store format refused The store format check found a store that is not at record format 3, cluster version 12, or a store with data and no store record. It wrote nothing. Check: The log line names the format and version it found. Act: Keep the old binary on the old store. Reset the store: export the data with the build that wrote it, start this build on an empty FoundationDB, and import the data, or use dynodb migrate. See first start.
A process or the fleet answers 503, or 400 ThrottlingException Admission limit (400), drain or backend loss First response
Latency grows on every action, then 400 ThrottlingException; fdyno_fdb_status_ratekeeper_limited_by is not workload The storage or log hosts cannot take the load: a bulk load, a lost storage host, or too few hosts The cluster is overloaded

FoundationDB is unavailable

Requests fail or time out. fdyno never acknowledges a write that did not commit.

Unsafe Region rebuild on FoundationDB 7.3.51 and 7.3.77

Do not use repopulate_anti_quorum to rebuild a lost Region on this pin. It lacks the remote log-prefix barrier fix: old transaction-log generations can be discarded before the rebuilt Region's logs have copied them. This warning comes from code analysis, not an observed loss.

See the Region policy and recovery limits.

  1. Leave fdyno processes running; a restart does not help.
  2. Restore FoundationDB. During recovery, /readyz can switch between 200 and 503 (foundationdb unreachable).
  3. When /readyz is 200 on every process, check fdyno_ambiguous_commit_outcomes_total. Writes that ended with The write may or may not have been applied during the outage have unknown outcomes.

Rebuild a permanently lost Region

This is a FoundationDB operator procedure; fdyno has no global tables. The example uses data DCs a and b, with their separate ca and cb satellite sets. B survives. Keep the existing satellite policy and locality settings.

Before the operator starts repair, a healthy current B log set with cb continues to protect new writes across Regions at usable_regions=2. Stored region JSON and old log generations do not establish that protection.

The reset creates a protection gap

At usable_regions=1, new B log generations use neither satellites nor a remote replica. New writes have one-Region durability. Accept this exposure explicitly. Do not inject another fault during repair. Do not use repopulate_anti_quorum on FoundationDB 7.3.51 or 7.3.77; the warning above applies even if the normal CLI accepts the setting.

  1. Fence the lost A processes permanently. Verify a complete readable B source and audit the acknowledged-write journal. Verify B's current three-log quorum and two healthy cb copies with zero write anti-quorums. Keep five live coordinators, split 2+2+1. Use fresh addresses and disks for replacement A processes. Save status and trace evidence throughout.
  2. Keep B preferred and make A ineligible for promotion. For this symmetric example, enter this token in fdbcli; replace IDs only to match the actual layout. Do not replace a different policy with this example blindly.
configure "regions=[{\"datacenters\":[{\"id\":\"a\",\"priority\":-1},{\"id\":\"ca\",\"priority\":1,\"satellite\":1}],\"satellite_redundancy_mode\":\"one_satellite_double\",\"satellite_logs\":2},{\"datacenters\":[{\"id\":\"b\",\"priority\":1},{\"id\":\"cb\",\"priority\":1,\"satellite\":1}],\"satellite_redundancy_mode\":\"one_satellite_double\",\"satellite_logs\":2}]"
configure usable_regions=1
  1. Verify the new current B-only epoch. Record its activation and commit version. Journal every new write ACK and audit those keys. Do not call this interval cross-Region protected.
  2. Start remote reconstruction without making A eligible:
configure usable_regions=2

Keep A priority -1. Negative priority blocks promotion, not replication. First verify that a new current B epoch again has its synchronous cb quorum. This ends the B-only logging interval, not the remote fill. 5. Wait for both complete storage replicas and healthy replica team trackers. Two quiet samples must show zero known queued or in-flight movement. Missing metrics are unknown, not zero. Audit every repair ACK. Only then set A's priority to 0, leaving B at 1. Repeat the region token above with A's -1 changed to 0. Recheck policy, quiet state and ACKs. A checked CLI refusal is a stop; never override it with FORCE.

Step What happens Current logs A priority
B + cb at 2 Step 1: verify B's current three-log quorum and two healthy cb copies with zero write anti-quorums. A is fenced; step 2 sets its priority to -1, so it cannot be promoted. Pictured: the symmetric example in step 2. B + cb -1
B only at 1 Step 2 ends with configure usable_regions=1. Step 3: verify the new current B-only epoch and record its activation and commit version. New writes have one-Region durability; journal every ACK and audit those keys. B only -1
B + cb at 2 Step 4: configure usable_regions=2, then verify that a new current B epoch again has its synchronous cb quorum. That verified epoch ends the B-only logging interval, not the remote fill: remote A may still be incomplete. B + cb -1
Full A, quiet, audit Step 5: wait for both complete storage replicas, healthy replica team trackers and zero known queued or in-flight movement, in two quiet samples; missing metrics are unknown, not zero. Audit every repair ACK. B + cb -1
A eligible Step 5: set A's priority to 0, leaving B at 1. Recheck policy, quiet state and ACKs. B + cb 0

A local FoundationDB 7.3.51 repair check ran this sequence. In it, commit versions assigned 54 acknowledged writes to the B-only epoch. The final B-client audit matched all 350 acknowledged keys. Returning to two Regions does not protect the writes made during the gap.

This is a finite local result. It does not measure WAN timing, uninterrupted availability, a direct A-only read audit or continuous cross-Region qualification. Measure these intervals again under WAN latency.

Unknown write outcomes

fdyno returns HTTP 500 The write may or may not have been applied when a timeout or lost response can hide a committed write.

  • TransactWriteItems with a ClientRequestToken: retry the identical request with the same token. Follow the client procedure to leave time for the server to check the token before it can expire.
  • A full-item PutItem and other converging writes: retry, if overwriting a newer write from another client is acceptable.
  • Increments and other read-modify-write updates: read the item, then decide.

Reliable writes has the full rules.

A process is at its limit

  • fdyno_requests_rejected_inflight_total rises: DYNODB_MAX_INFLIGHT is full. Clients get 400 ThrottlingException and retry. Add processes, or raise the limit if memory allows.
  • fdyno_http_connections{state="rejected"} rises: the connection cap is full. Check client connection pools, or raise the cap and RLIMIT_NOFILE.
  • fdyno_requests_throttled_total{reason="contention"} rises: clients write one item faster than it can commit. Spread the writes over more keys. The refused writes did not commit.

The cluster is overloaded

fdyno pushes back with latency first, then with 400 ThrottlingException. See Overload for what clients see.

Signal Alarm when Meaning
fdyno_fdb_status_ratekeeper_limited_by{priority="default"} reason is not workload for 1 min Ratekeeper slows every request
fdyno_fdb_status_storage_queue_bytes, fdyno_fdb_status_storage_data_lag_seconds queue above 1 GB, or data lag above 10 s Storage cannot keep up (fdhl4: 1.97 GB queue)
fdyno_request_duration_seconds p99 above 1 s for 5 min The latency-first overload signal
fdyno_transaction_fdb_errors_total{code="1213"}, {code="1051"}, fdyno_requests_rejected_inflight_total any sustained rate Definite refusals; safe to retry
fdyno_hotkey_wait_rejections_total, fdyno_hotkey_queue_rejections_total any One item is past its rate; spread the key
fdyno_transaction_timeouts_total, fdyno_ambiguous_commit_outcomes_total any rise Budgets run out; some outcomes are unknown
fdyno_gsi_backlog_max_age_seconds above 5 s Writes that change a GSI are throttled
fdyno_worker_last_lease_held_tick_age_seconds rising Background work starves
  1. Find the cause. Read fdbcli --exec status: the Performance limited by line, the data state (healing means a host or process is lost) and the storage queues.
  2. A bulk load: slow it to 10 MB/s or less of item bytes per storage host. See pace a bulk load.
  3. A lost storage host: bring it back, or replace it. While it is down, watch the TLog disks: the TLog queues hold all new writes until the copy ends (fdhl5: 2.9 GB per minute per log host at 8,000 writes/s). See losing a storage host.
  4. Steady load above capacity: add storage hosts, one per data hall. See Capacity planning.
  5. Apply the unknown write procedure before you retry writes that timed out.

A worker falls behind

The TTL sweeper, stream trimmer and PITR trimmer each export a backlog age. Check ownership and measurement freshness before interpreting the age. For overdue undo records, see the PITR trim signal.

  1. Find a recent pass. Match fdyno_worker_lease_held{worker="..."} with fdyno_worker_last_lease_held_tick_age_seconds on the same process. The lease flag reports what that process observed on its last tick, not a live lock read. During takeover, a process can still report an old flag. A worker transaction checks its lease epoch before it writes; a takeover prevents the old epoch from committing. fdyno_lease_fence_rejections_total counts rejected effects, not duplicate writes. Do not delete leases by hand. See the takeover tests.
  2. Check coverage and freshness. Read backlog ages on the lease holder. A process reports zero once its tick observes that it does not hold the lease. For TTL and CDC, check the corresponding fdyno_ttl_oldest_eligible_valid or fdyno_cdc_trim_oldest_valid flag and measurement timestamp. A partial age is a lower bound. A low value with incomplete coverage does not show that the worker caught up. TTL age measures the eligible minute bucket, not time to delete an item.
  3. Separate budget, contention and failure. Use changes in counters across passes on that process, not their absolute totals. Check the relevant *_tick_budget_exhausted_total for a TTL or CDC pass that hit its time or delete limit. Check fdyno_ttl_backfill_contended_total or fdyno_cdc_trim_contended_total for a page deferred after conflicts. Also check fdyno_worker_reported_failures_total and the worker failure log. A flat failure counter does not rule out contention or native throttling.

If expiry passes run out of time or FoundationDB throttles them, check queues, disk and foreground load first.

Cleanup workers that use batch priority can move to default priority after twice their interval (capped at five minutes) without a complete pass. The warning names the worker. fdyno_worker_priority_escalations_total records the transition, and fdyno_worker_priority_escalated shows the process's current priority state. Default-priority cleanup can compete with foreground traffic; the flag is not proof of a FoundationDB outage. A slow worker does not make TTL-expired items visible again. Old stream records use storage.

When cleanup moves to default priority

Each cleanup worker has its own priority state in each process; backup import staging has one state per import (background_transactions.go). The state is checked when a pass starts and updated when it ends. It uses the process's monotonic clock and is not stored, so a restart begins again at batch priority.

Priority and event Result
Batch; a pass starts with no complete pass for the bound Moves to default priority: warning log, escalations_total +1, escalated = 1.
Batch; a complete pass Stays at batch priority; the timer clears, and the next pass starts a new one.
Default; a complete pass Back to batch priority; escalated = 0; the timer clears, and the next pass starts a new one.
Term Value
Bound min(2 × worker interval, 5 min). Backup import staging uses half its page deadline. A throttled page moves to default priority only when a later retry starts after the bound; the page deadline or a cancellation can end it first.
Workers TTL sweep, stream trim, PITR trim, transaction-token cleanup, backup staging cleanup and backup import staging.
Complete pass Stream trim: no exhausted budget, no throttle deferral and a valid oldest-age reading. Token cleanup: the scan wrapped with no deferral. PITR trim: no error, no stop at its record cap or time budget, no failed table, and no error from the deleted-table stream expiry. Backup staging cleanup: the pass ended without an error. TTL sweep: the pass reports complete, and no enabled TTL backfill is left unwrapped. Import staging: the step succeeded.
No lease For every listed worker except TTL sweep and import staging, a tick that does not get the worker lease counts as complete when a peer holds the lease (no failure counted). A lease check whose transaction fails does not count as complete, so it does not clear the timer (the timer keeps running from the start of the first pass after the last complete one) (transaction_runner.go). Its failure is counted in fdyno_worker_reported_failures_total, except a cancellation such as shutdown.
Throttle A FoundationDB throttle error (1051 batch, 1213 tag) during a pass's cleanup work leaves the pass incomplete; a failed lease check follows the No lease row. Stream trim and token cleanup defer the rest of the pass; PITR trim, backup staging cleanup and TTL sweep end it as incomplete. The worker interval is the backoff. For these workers, an attempt whose commit outcome may be unknown is not treated as a throttle. Import staging instead retries the step with a bounded exponential delay, and it does treat a throttle error wrapped in an unknown outcome as a throttle: a replay is safe because a page group whose manifests are all present is accepted once (backup_archive_fdb.go).

GSI lag grows on a GSI-heavy table

Use this section when a table has many GSIs (for example 10), its write rate is high, and GSI lag or GSI write latency grows with the write rate. First make sure that the GSI applier runs: no GSI apply failed warning, and fdyno_gsi_apply_records_total still rises. If the applier fails, use FdynoGSIReplicationStalled.

Why it happens

Each write that changes a GSI writes the item, one GSI change record and, after the apply, the GSI entries. With 10 GSIs and three replicas, this was about 100 KB of storage input per write in our tests. ssd-redwood-1 wrote about 8 KiB per disk I/O and 4.2 to 4.8 bytes to disk for each durable byte. When the disk of a storage host reaches its write IOPS, its storage queues grow, and then Ratekeeper limits the write rate of the whole cluster. Ratekeeper only reports the limit: it holds the limiting storage queue at its target of about 1 GB.

The input is also uneven. Each GSI change record goes to the table's GSI change log. The log has 8 shards. Its keys are (gl, shard, versionstamp, ...) under the table's prefix, and the versionstamp increases, so new records go to the end of each shard. The applier removes a record after it applies it, so the log stays small. FoundationDB splits key ranges by size, so the small log stays in few FoundationDB shards. In our tests, the ends of the 8 log shards were often on one storage team. That team takes the record bytes of every write, in addition to its share of items and index entries. In our tests this skew was not the limit: a build without the shared log removed most of the skew, and the rate did not rise.

Evidence (FoundationDB ssd-redwood-1, the fd-l-n10 write mix with 10 GSIs):

  • On 17-host fleets with 6 storage hosts (fdna8, fdnb7, fdns3, fdpa3, fdpb3, i4i.xlarge), 8,000 writes/s was not delivered. Ratekeeper was limited by the storage write queue. Each storage host took about 91 to 107 MB/s of storage input at the limit, with 2 or 4 storage processes per host. Its NVMe disk ran at 51,200 to 54,100 write I/Os per second on average per run, and the busiest host at 54,200 to 54,600. AWS lists 55,000 write IOPS for the i4i.xlarge disk (for 4 KiB writes). A 17-host fleet with 6 storage hosts and 2 storage processes each (fd2) delivered 5,353 writes/s at 8,000, at about 90 MB/s per host (estimated with the fdna8 bytes per write). One run each.
  • The three storage processes with the most input were one team. In fdns3, the busiest storage process took 92.7 MB/s against a mean of 23.6 MB/s. On one host (FoundationDB data on RAM storage), shard maps showed that the storage process with the most input held the most log ends (5 to 8 of 8) in every run.
  • In fdpb3, a build that keeps the change record in its item's key range (5bacb8b5, not merged), the busiest storage process took at most 51.8 MB/s, but the run delivered 5,674 writes/s at 8,000 against 6,171 for main in fdpa3.
  • On a 31-host fleet with 18 storage hosts and 3 API hosts (fdt3, build efdc1ad3), the same 10-GSI test held 8,000 writes/s. With 12 storage hosts (fdtw3, same build, n=1) it also held 8,000 writes/s; the busiest storage host ran at 42,893 write IOPS, 78% of the listed 55,000.
  • On one host at the same load per storage host (runs engio, build ef50b4af, n=2 per engine), RocksDB (ssd-rocksdb-v1) made 0.73 disk write I/Os per write against 13.33 for Redwood, but used 2.0 times the storage CPU per write (about 1,110 µs against 560 µs). On i4i.xlarge, that would move the limit to the CPU. See storage engine and disks.

See GSI fan-out fleet.

Check

  1. fdyno metrics. On a table with this problem:
    • fdyno_gsi_backlog_age_seconds{table} rises with the write rate;
    • the fdyno_gsi_apply_lag_seconds p99 rises;
    • when the backlog is older than 5 s, writes that change a GSI of the table get ThrottlingException ("a global secondary index is behind on replicating writes").
  2. FoundationDB status. Read the storage roles in status json:

    fdbcli --exec 'status json' | jq -r '
      .cluster.qos.performance_limited_by.name,
      (.cluster.processes[] | .address as $a | .roles[]? | select(.role=="storage") |
       [$a, (.input_bytes.hz/1e6|floor), ((.input_bytes.counter-.durable_bytes.counter)/1e6|floor),
        .durability_lag.seconds] | @tsv)'
    

    The columns are address, input MB/s, write queue MB and durability lag in seconds. The limit is storage_server_write_queue_size. Add the input of the processes on each host (same IP address): if every storage host is near the same input and the queues grow, the hosts are at their write rate. Then read the disk write rate of each storage host:

    fdbcli --exec 'status json' | jq -r '.cluster.processes[] |
      select(any(.roles[]?; .role=="storage")) |
      [(.address|split(":")[0]), (.disk.writes.hz|floor), .disk.busy] | @tsv' | sort -u -k1,1
    

    The columns are host IP, disk write I/Os per second and busy. Compare the write rate with the write IOPS that your provider lists for the disk. Do not use busy: in our tests it read 0.29 at 53,500 write I/Os per second, near the listed limit. If a few storage processes (one team, one per zone or data hall) have input well above the others, step 3 tells you if they hold the GSI change log. 3. Map the log to storage processes. Find the table's key prefix: call /fdb/key-locations for any item of the table. In physical_key_hex, the prefix is the bytes before 026900 (the item subspace i). Then:

    • FoundationDB shards in the log, with their write rate (fdbcli):

      P='\x15\x2a'   # the table prefix as \x escapes, from physical_key_hex
      fdbcli --exec "option on SPECIAL_KEY_SPACE_RELAXED; getrange \"\\xff\\xff/metrics/data_distribution_stats/${P}\\x02gl\\x00\" \"\\xff\\xff/metrics/data_distribution_stats/${P}\\x02gl\\x01\" 100"
      

      It lists the FoundationDB shards that begin inside the log. The start of the log is in the shard before the first row. A shard that writes faster than 1 MB/s shows 1e9 bytes per ksecond, not its real rate.

    • fdbcli has no command that names the storage processes of a key. From a source checkout, run go run ./tools/glteam <cluster file>. It only reads. For each FoundationDB shard boundary of each table it prints the subspace and the storage addresses. python3 tools/glteam/report.py counts how many log ends each storage process holds (see tools/glteam/README.md).

If the storage processes with the most input from step 2 hold the gl ends and gc (the applier's cursor), the GSI change log causes the skew. In our tests, removing that skew did not raise the rate.

What to do now

  • Add storage hosts. In our tests, a fleet with 18 storage hosts (and 3 API hosts) held 8,000 writes/s, and fleets with 6 storage hosts did not: with 2 storage processes per i4i.xlarge host, the highest 10-GSI rate held went from 2,000 (fd2, 6 hosts) to 8,000 writes/s (fdt3, 18 hosts), and 12 hosts also held 8,000 (fdtw3, n=1). Add hosts, not storage processes on the same hosts. Size the storage hosts by their disks' write IOPS: in these tests, one i4i.xlarge host (55,000 listed write IOPS) reached its limit at about 3,000 replica writes/s with 10 GSIs (writes/s × 3 replicas ÷ storage hosts). Hosts with more NVMe write IOPS were not tested. Then add 1 storage host per data hall if the fleet must hold the rate after losing a host: see Capacity planning.
  • If GSI lag, not the write rate, is the problem, add storage hosts too. The GSI lag grows before the write rate stops. In our tests at 8,000 writes/s with 10 GSIs, 12 storage hosts held the rate, but the GSI lag was higher than with 18 storage hosts. The team with the GSI change log tails was busier (0.79 against 0.69 core). See GSI fan-out fleet.
  • Use fewer GSIs on the table, or KEYS_ONLY projections. Each change record holds the old and new entry of every GSI that the write changes, so fewer or smaller GSI entries make the record smaller.
  • Write more slowly to that table. Let clients back off on ThrottlingException.
  • More storage processes on the same hosts do not help. In fdns3, twice as many storage processes per host halved the median input, but the rate at 8,000 writes/s did not rise (5,940 against 5,867 writes/s).
  • We do not recommend a FoundationDB knob. We tested data distribution knobs, including ENABLE_WRITE_BASED_SHARD_SPLIT, on one host with the FoundationDB data on RAM storage. They did not move the log ends reliably: in one of three settings the ends spread after about 10 minutes, and in the others they stayed on one storage process. These knobs change data movement for the whole cluster, and we did not test them on a fleet.

A TTL row is skipped

fdyno_ttl_drain_entries_skipped_total{table="..."} rises when the TTL drain cannot read or delete one row of that table on its own and reads past its expiry entry. The other entries of the table still drain. The skipped entry and its row stay and remain eligible: a later pass that reaches the entry tries it again. Three things can keep a pass from reaching it: the deadline, a peer holding the range, or the limit of 16 skips per table and range per pass.

A skip does not show that the row is expired. A read failure happens before the drain checks the row's TTL: the row may be unreadable, or a client may have refreshed it.

  1. Find the table. The counter names the table; after 100 tables, the rest share the label _other. The ttl-sweeper worker failure log also names it, with an opaque entry fingerprint and the stage that failed (item read or row delete). The log is rate limited and does not show key values. The counter does not tell whether the same row fails in every pass.
  2. Check the table. Run dynodb verify table <name> --ttl-index. It finds rows that do not decode and expiry entries that do not match their rows (Verify stored data).
  3. Act. Fix the cause. A counter that stops rising does not show that the row was deleted or refreshed. A later pass may not have reached its entry. Run the verify command again to confirm. Do not clear expiry entries by hand: a row without an entry can stay stored.

A lease expiry is implausibly far ahead

fdyno_worker_lease_implausible_expiry_total{worker} counts each lease value whose expiry is more than the lease lifetime plus 5 minutes past this process's clock. The worker label is the worker name, or restore-recovery, import or export for job leases. The warning log lease expiry is implausibly far ahead of this process's clock gives the holder's owner id and the lead in seconds.

  1. Find the wrong clock. The owner id starts with the holder's host name. Compare the clock of that host and of this host with an NTP reference. One of them is off by about the lead.
  2. Fix that host's time sync. A clock ahead by more than one minute is outside the clock contract.
  3. If the holder is stopped, no action is needed. A peer can take the lease one lease lifetime after it first saw it, if the expiry is still implausible then. Otherwise it takes the lease at its first check at or after the stored expiry (see A clock far ahead). In the first case the peer logs lease stayed unchanged for one lifetime with an implausible expiry; trying to take it over (rate-limited).
  4. If the holder is alive, it keeps the lease while it renews, and the count keeps rising. After its clock is corrected backward, restart the holder. The restart gives it a new owner ID. Its next lease is written from the corrected clock. Without a restart it keeps the implausible expiry until its clock catches up, and the count keeps rising. The other records that this clock wrote are listed in A clock far ahead.

A job pauses after a clock was stepped back

A holder can stop without releasing the lease of a PITR restore, restore, import or export job. The job can then wait longer than one lease lifetime (3 minutes for a job lease) before another process continues it. Check whether the holder's host stepped its wall clock back shortly before it stopped. The time-sync daemon's log shows a past step (for chrony, journalctl -u chronyd with a line System clock was stepped by ...). chronyc tracking shows only the current offset.

The lead that remains can be at most the lease lifetime plus 5 minutes. Then nothing on the other processes names this pause. fdyno_worker_lease_implausible_expiry_total and its warning stay silent. Do not wait for a signal; use the time-sync log.

  1. Check when a peer can take the lease.
  2. No action is needed for the job. The delay changes only when another process may take it. Its recovery after the takeover is the same as after any takeover. Do not delete the job's lease or records by hand.
  3. Fix that host's time sync so that it slews instead of stepping by more than the clock contract allows.

A new index stays CREATING

Query and Scan on a CREATING GSI fail until its backfill finishes. Read DescribeTable for the specific index's status. fdyno_index_backfill_jobs_running and the backfill counters are process-local summaries of all jobs, not a progress percentage for your index.

  1. Find the worker's latest lease-held pass for worker="index-backfill". Compare fdyno_index_backfill_pages_total with fdyno_index_backfill_items_total. A page can advance the durable cursor without writing any entries, for example through sparse items. A flat item counter alone does not mean the job is stuck.
  2. If pages stop, or fdyno_index_backfill_oldest_failing_job_seconds rises, check the GSI backfill job attempt failed with no page known to be committed, worker failure and GSI backfill pass failed logs and FoundationDB errors. The first names the table ID and index of each failing job. Native throttling can defer a pass without a failure log; check the native throttle counters. A new worker can resume at the last committed cursor. Do not edit the job cursor or mark the index active by hand.
  3. If fdyno_index_backfill_skipped_oversized_total rises, use the warning's table ID and index name to find the affected index. An oversized key is skipped, not retried forever. ACTIVE does not mean those rows were indexed. Fix the key design before relying on those entries.

See how backfill publishes an active index and the oversized-key test.

A restore stays CREATING

Both restore APIs answer CREATING once the admission commits. The restore-recovery worker then applies the job's pages; recovery resumes a job after a process restart.

  1. Check DescribeTable on the target.
  2. Check fdyno_restore_jobs_failed_total and the logs.
  3. To cancel, delete the CREATING target table, only under the conditions in cancel a restore target below.

A data error ends the restore. Every retry fails the same way for:

  • a backup page that is missing, does not decode or fails its digest;
  • a backup whose generation changed after the restore started;
  • an item whose key attribute is missing, has a type the target does not declare, or cannot be stored (an empty string);
  • an item whose index key is invalid;
  • a page whose write exceeds a FoundationDB size limit (errors 2101, 2102 and 2103);
  • a job record this build cannot read, for example a version 1 job from an older build.

In these cases the recovery worker marks the job FAILED. In the same transaction, it removes the CREATING target if it is still this job's target, and releases the backup's restore pin. Other errors leave the job for the next pass.

What you see:

  • DescribeTable on the target returns ResourceNotFoundException, unless another table took the name.
  • A restore-recovery worker failure log line, if one is emitted for this cause, contains the reason and the job ID. Rate limiting, or an earlier error in the same pass, can suppress it.
  • The reason names the page, attribute and types, never key values.
  • fdyno_restore_jobs_failed_total is local to the process. That process adds one after it confirms that the failure committed; if it exits before then, there is no increment.

The backup itself may be damaged: run dynodb verify backup before you restore from it again.

A restore request after a lost commit reply. The admission creates the target, the job and the backup's pin in one transaction. A request makes its job ID once, so an internal retry after a lost commit reply finds its own job and answers CREATING. A client retry of the whole request finds the name taken and gets an error. After any restore error, check the target before you retry:

Target after the error Do
Absent No restore job can create it: the admission did not commit, or the job failed or was cancelled. Retry the restore.
ACTIVE If its TableId is the one a restore response returned, keep it. If you cannot establish that it is the original target, do not switch traffic to it or delete it. To check it, stop writes, DDL and workers, then run dynodb verify restore against the same backup with --quiesced.
CREATING A restore job is running. Keep monitoring.

While a restore job runs, DeleteBackup on its USER backup returns BackupInUseException, and the SYSTEM backup expiry skips the backup. DeleteBackup always refuses a SYSTEM backup (ValidationException); only its expiry removes it.

Cancel a restore target

DeleteTable on a CREATING target is an intentional cancellation, not automatic recovery. DeleteTable takes only a table name and acts on that name's table in any status. Use it only when all of these hold:

  • You have verified that the table is the original target of this restore: no earlier table of that name was reused.
  • No other restore, import, CreateTable or DeleteTable for that name runs from the check through the deletion.
  • You are willing to discard the original target, even if it becomes ACTIVE after your last check.

An earlier CREATING observation is not a condition of the delete. If any condition does not hold, keep monitoring instead.

A restore target keeps the backup's DeletionProtectionEnabled; a restore cannot override it, and UpdateTable cannot clear the flag while the table is CREATING. A protected target can be deleted once its restore job is FAILED, also after cleanup has removed the failed job's record. While the job can still run, DeleteTable refuses it. After a deliberate DeleteTable, retry the restore and wait for ACTIVE.

Rotate credentials

  1. Add the new key to the credentials file.
  2. Send SIGHUP to every process. Check fdyno_credentials_reloads_total.
  3. Move clients to the new key.
  4. Remove the old key and send SIGHUP again.

A failed reload keeps the previous keys and increments fdyno_credentials_reload_failures_total. See credentials.

Rotate the TLS certificate

Write the new certificate and key to new files. Rename them over the old paths. fdyno checks the files every 5 seconds. It reloads after two checks see the same change. Send SIGHUP to reload without waiting for those checks. Open connections keep the old certificate. Check fdyno_tls_certificate_not_after_seconds.

Change FoundationDB coordinators

FoundationDB writes the new coordinators into each client's cluster file; fdyno keeps working.

  1. Check that fdyno_fdb_cluster_file_writable is 1 on every process.
  2. Change the coordinators with fdbcli.
  3. Check that each process's cluster file names the new coordinators.

A process whose file was not updated works until a restart. Then it logs FoundationDB startup connectivity check failed and exits 1 after its 10 s startup check. Copy a current cluster file and restart.

Find where a key is stored

GET /fdb/key-locations on the operations listener returns the storage servers of an item or index entry, to tie a hot key to a storage process.

curl --get http://127.0.0.1:9100/fdb/key-locations \
  --data-urlencode 'table=orders' \
  --data-urlencode 'key={"pk":{"S":"customer-1"},"sk":{"N":"42"}}' \
  --data-urlencode 'index=by_status'      # optional

The response has physical_key_hex and addresses; join the addresses to fdbcli status json for zones and data centers. Data movement can change the team. The lookup reads at default priority with a 2-second budget. It does not wait in the batch queue, so it can succeed when batch work is starved; a backend timeout still returns HTTP 503. The route has no rate limit, so send sparse probes. The query string holds application keys, so keep it out of shared logs.

Storage replica consistency

Enable consistencyscan during cluster setup. Use fdbcli -C /etc/foundationdb/fdb.cluster --exec 'status json' to check cluster.consistency_scan_info: confirm that finished_rounds advances. If the scan adds too much load, lower maxRate and check foreground latency again. An enabled scan is not proof that a round has finished.

On ConsistencyCheck_DataInconsistent, preserve the FoundationDB traces and status output, then investigate before repairing or rebuilding anything. The traces can contain keys. dynodb verify does not compare replicas.

Verify stored data

dynodb verify checks DynamoDB-level data and metadata. It reads FoundationDB at batch priority, changes nothing, and starts no listener or worker.

dynodb verify table orders --cluster-file /etc/foundationdb/fdb.cluster
dynodb verify backup "$BACKUP_ARN" --cluster-file /etc/foundationdb/fdb.cluster
# Only after you stop writes, DDL and workers on every process:
dynodb verify restore "$BACKUP_ARN" orders --cluster-file /etc/foundationdb/fdb.cluster --quiesced
Command Checks
verify table Table metadata, secondary indexes, the TTL expiry index and stream trim positions.
verify backup Page inventories, item counts and page checksums.
verify restore That a restored table holds the same items as its backup.
Exit status Meaning
0 No difference found.
2 A difference found. With live writes, repeat the check after you stop writes.
1 An error, or an inconclusive restore check without --quiesced.

For TTL only, run dynodb verify table orders --ttl-index --cluster-file /etc/foundationdb/fdb.cluster. The expiry index explains stale and missing entries.

In the table's JSON counts, ttl_due_missing_entry counts rows in a sweep-eligible bucket whose expected expiry entry is missing after backfill completed. A stale entry in a different bucket does not count as the expected entry, but it can still let the sweeper reach the row. ttl_due_pending_backfill counts the same condition while backfill is still open; this alone does not show a stranded row. The counts use one ttl_evaluation_time in Unix seconds, adjusted by DYNODB_TTL_SKEW_MARGIN. They are subsets of the existing missing-entry and pending-backfill findings, not extra differences. They do not identify the cause of a missing entry.

The TTL check scans both the table and its expiry index, so total read work grows with their size. The new counts use the existing reads. --page caps rows per read page (default 64, maximum 100), with a decoded-size target of 1 MiB plus one item. Use --timeout to limit the audit duration (default 30 minutes); a timeout is an error, not a clean result.

Live writes can cause short-lived findings in verify table; counts describe the pages observed, not one database snapshot. For verify restore, --quiesced states that writes and workers are stopped; the tool does not check it. JSON reports go to stdout and can contain item keys. dynodb verify --help lists all flags.