fix(gc): improve handling of database errors and review postponing
Related to #440 (closed). Please see the issue for a description of the problem and the solution we're after in this MR.
Database review
This MR adds one new query:
SELECT
top_level_namespace_id,
repository_id,
manifest_id,
review_after,
review_count
FROM
gc_manifest_review_queue
WHERE
top_level_namespace_id = $1
AND repository_id = $2
AND manifest_id = $3
FOR UPDATE
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------
LockRows (cost=0.15..8.18 rows=1 width=42) (actual time=4.866..4.873 rows=1 loops=1)
-> Index Scan using pk_gc_manifest_review_queue on gc_manifest_review_queue (cost=0.15..8.17 rows=1 width=42) (actual time=3.657..3.663 rows=1 loops=1)
Index Cond: ((top_level_namespace_id = 34) AND (repository_id = 48) AND (manifest_id = 7))
Planning Time: 22.349 ms
Execution Time: 7.091 ms
(5 rows)
Edited by João Pereira