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]