HomeSoftware Heritage

origin_visit_add: Fix crash when adding multiple visits to the same origin…

Description

origin_visit_add: Fix crash when adding multiple visits to the same origin simultaneously

This works by adding a RW lock on the row of the latest visit,
which should block other transactions until the insertion
is committed; so other transactions will generate a different
(larger) visit id

This commit also slightly rewrites how the max visit id is
computed, as we need to actually select a row to lock it,
instead of using the max() aggregate function.

Details

Provenance
vlorentzAuthored on Aug 18 2022, 10:29 AM
vlorentzPushed on Aug 25 2022, 10:01 AM
Differential Revision
D8250: origin_visit_add: Fix crash when adding multiple visits to the same origin simultaneously
Parents
rDSTO5335244fc187: retry: Add constant 10s wait when retrying transient exceptions
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task
Build Status
Buildable 31056
Build 48586: test-and-buildJenkins console · Jenkins