Skip to content

SQLIndex: report blobs marked deleted as missing

Zehao Chen requested to merge zchen723/mitigate-sql-data-race into master

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests
  • Metrics
  • Documentation update(s)

Description

Before this MR, SQLIndex reports blobs marked deleted as existing. This is a data race if a client calls FMB, believes a blob exists, but the blob is later deleted by the cleaner.

This short MR changes the behavior to report such blobs as missing, so the clients are required to re-upload the blob.

I don't think this fix will solve all data races. It's possible that the following sequence of events can happen:

  1. A blob is marked as deleted
  2. Cleaner collects rows marked as deleted, initiating deletes in the underlying storage
  3. Client calls FMB and finds the blob missing
  4. Client puts the blob
  5. The delete in the underlying storage is handled

In this case, the blob cannot be found when the client uses it, though it might be less confusing than reporting deleted blobs as existing.

Edited by Zehao Chen

Merge request reports