Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/fleet-schedule-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ The OS-timer half of surface 2. Cadence is the unit's own `OnCalendar`/`OnUnitAc
| `git-maintenance@daily.timer` | `OnCalendar=Tue..Sun *-*-* 00:56:00` | `git-maintenance@daily.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `git-maintenance@hourly.timer` | `OnCalendar=*-*-* 01..23:56:00` | `git-maintenance@hourly.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `git-maintenance@weekly.timer` | `OnCalendar=Mon *-*-* 00:56:00` | `git-maintenance@weekly.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `fleet-queue-backup-export.timer` (repo-shipped, not yet installed) | `OnCalendar=*-*-* 02:15:00` + `RandomizedDelaySec=30m` | `fleet-queue-backup-export.service` | laptop (user systemd; code#8584) | not recorded | Disable if a scheduled export cannot verify its read-back counts; repair the cause (credentials, D1, schema) and rerun before re-enabling | 2026-11-22 | 2026-11-22 |
| `fleet-queue-backup-export.timer` (installed on the laptop 2026-11-22, #8584 live half) | `OnCalendar=*-*-* 02:15:00` + `RandomizedDelaySec=30m` | `fleet-queue-backup-export.service` | laptop (user systemd; code#8584) | not recorded | Disable if a scheduled export cannot verify its read-back counts; repair the cause (credentials, D1, schema) and rerun before re-enabling | 2026-11-22 | 2026-11-22 |
| `github-backup-drain.timer` | `OnCalendar=*-*-* *:00/5:00,OnBootUSec=3min` | `github-backup-drain.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `github-backup-fetch.timer` | `OnCalendar=*-*-* 00:00:00` | `github-backup-fetch.service` | laptop (user systemd) | not recorded | not recorded | not recorded | 2026-11-04 |
| `github-backup-r2.timer` (repo-shipped, not yet installed) | `OnCalendar=*-*-* 01:30:00` + `RandomizedDelaySec=30m` | `github-backup-r2.service` | laptop (user systemd; code#8584) | not recorded | Disable if any scheduled run cannot verify every planned R2 object; repair credentials or target and rerun before re-enabling | 2026-11-22 | 2026-11-22 |
Expand Down
12 changes: 11 additions & 1 deletion infra/fleet-queue-backup/bin/export_to_d1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def export(source_url, d1_name, create):
_require_env("CLOUDFLARE_API_TOKEN"), _require_env("CLOUDFLARE_ACCOUNT_ID")
)
exported_at = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
dump, counts = fq_common.build_dump(source, exported_at)
dump, counts, splits = fq_common.build_dump(source, exported_at)
db = d1.find_database(d1_name)
if db is None:
if not create:
Expand All @@ -52,6 +52,16 @@ def export(source_url, d1_name, create):
db = d1.create_database(d1_name)
db_id = db["uuid"]
d1.import_sql(db_id, dump)
for table, col, where, expected in splits:
rows = d1.query(
db_id,
f'SELECT length("{col}") AS n FROM "{table}" WHERE {where}',
)
if len(rows) != 1 or rows[0].get("n") != expected:
raise RuntimeError(
f"split-row verification failed for {table}.{col}: "
f"expected one row of length {expected}, got {rows}"
)
meta = d1.read_meta(db_id)
if meta is None:
raise RuntimeError("D1 copy has no export meta after import; import is suspect")
Expand Down
Loading