Skip to content

Duplicate probe insert #745

@alexey-yarmosh

Description

@alexey-yarmosh

#744 confirmed that the problem are 2 hosts running inserts with the same data (only id and date fields are different).
Also, looks like inserts from different hosts are called at the same second (+-1), which is strange, unless the processes are restarted simultaneously during deploy.

As a fix I propose storing a lock key in redis with TTL of 55 seconds:

  1. All processes are trying to redis.set('dashboard-probes:synced', true, { NX: true, EX: 55 } every 60 seconds
  2. If result is null => probes are synced => return
  3. If result is OK => probes are not synced => proceed with syncing

Previous logic with workers and SHOULD_SYNC_ADOPTIONS can be removed as not required.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions