diff --git a/queue/queue.go b/queue/queue.go index 21dcdd3..e81e341 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -14,11 +14,11 @@ import ( var log = logging.Logger("provider.queue") -// Queue provides a durable, FIFO interface to the datastore for storing cids +// Queue provides a best-effort durability, FIFO interface to the datastore for storing cids // -// Durability just means that cids in the process of being provided when a -// crash or shutdown occurs will still be in the queue when the node is -// brought back online. +// Best-effort durability just means that cids in the process of being provided when a +// crash or shutdown occurs may be in the queue when the node is brought back online +// depending on whether the underlying datastore has synchronous or asynchronous writes. type Queue struct { // used to differentiate queues in datastore // e.g. provider vs reprovider @@ -102,12 +102,6 @@ func (q *Queue) work() { log.Errorf("error deleting queue entry with key (%s), due to error (%s), stopping provider", head.Key, err) return } - - if err := q.ds.Sync(k); err != nil { - log.Errorf("error syncing deletion of queue entry with key (%s), due to error (%s), stopping provider", head.Key, err) - continue - } - continue } } else { @@ -130,12 +124,6 @@ func (q *Queue) work() { log.Errorf("Failed to enqueue cid: %s", err) continue } - - if err := q.ds.Sync(k); err != nil { - log.Errorf("Failed to sync enqueuing cid: %s", err) - continue - } - case dequeue <- c: err := q.ds.Delete(k) @@ -143,12 +131,6 @@ func (q *Queue) work() { log.Errorf("Failed to delete queued cid %s with key %s: %s", c, k, err) continue } - - if err := q.ds.Sync(k); err != nil { - log.Errorf("Failed to sync deleted queued cid %s with key %s: %s", c, k, err) - continue - } - c = cid.Undef case <-q.ctx.Done(): return