Plenty of apparently stuck insert queries in the db [1] with a db still empty [2] (out of [3])
So something must be wrong somewhere.
Let's investigate and fix that.
[1]
1022114 swh-scrubber swh-scrubber 127.0.0.1/32 0.0 0.0 0B 0B 503 h transactionid N active INSERT INTO datastore (package, class, instance) VALUES ('storage', 'postgresql', 'user=guest password=xxx dbname=swh host=db1.internal.staging.swh.network port=5432') ON CONFLICT DO NOTHING RETURNING id
And nothing actually written in the scrubber db as of yet since its deployment around 3 weeks ago.
15:24:26 swh-scrubber@db1:5432=> select * from corrupt_object ; +----+-----------+--------+------------------+ | id | datastore | object | first_occurrence | +----+-----------+--------+------------------+ +----+-----------+--------+------------------+ (0 rows) Time: 7.313 ms 15:29:39 swh-scrubber@db1:5432=> select * from datastore; +----+---------+-------+----------+ | id | package | class | instance | +----+---------+-------+----------+ +----+---------+-------+----------+ (0 rows) Time: 13.705 ms 15:29:43 swh-scrubber@db1:5432=> select * from object_origin ; +-----------+------------+--------------+ | object_id | origin_url | last_attempt | +-----------+------------+--------------+ +-----------+------------+--------------+ (0 rows) Time: 5.291 ms
[3]
root@db1:~# sudo -i -u postgres pg_activity -p 5433 dbname=swh-scrubber