indexer icon indicating copy to clipboard operation
indexer copied to clipboard

common: 879 duplicate queued actions - composite index

Open dwerner opened this issue 1 year ago • 1 comments

Resolves #879

After testing seeing https://github.com/graphprotocol/indexer/pull/883, I set out to write a unit test that would prove if #879 were indeed resolved.

I ended up with a test that would sporadically fail, depending on timing.

My first approach here was to introduce an advisory lock, which I removed in favor of this PR's composite index and unique constraint on deploymentID and source. Now a GQL validation error occurs when the duplicate is about to be inserted.

Looking for feedback on this approach.

dwerner avatar May 01 '24 22:05 dwerner

Converting to a draft as I address some test failures.

dwerner avatar May 02 '24 14:05 dwerner

Closing this PR because it would entail either a constraint for which old data would conflict or a table level lock.

dwerner avatar Jul 12 '24 18:07 dwerner