genhistorydb

command
v2.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Command genhistorydb builds a user.db full of legacy MediaHistory rows (no identity snapshot, policy version 0) for stress-testing the media history identity backfill sweep on real hardware. Rows are written through the production userdb code path so the schema and row shape are exactly what a device that recorded history before the identity upgrade holds.

Point -mediadb at a copy of the target device's media.db to make a fraction of rows resolvable against its real index (exercising identity construction, row updates, and re-sync marking); the rest use fabricated paths that can never resolve (exercising the skip path). Copy the result over the device's user.db (service stopped, original backed up) and watch the sweep.

Usage:

go run ./scripts/genhistorydb -out ./tmp/stress -rows 50000 \
  [-mediadb ./tmp/media.db] [-resolvable 0.7] [-nouuid 0.1] [-span-days 365]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL