Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Chain: Underlying Store fails on PUT - what to do? #10

Open
VojtechVitek opened this issue Oct 20, 2015 · 1 comment
Open

Chain: Underlying Store fails on PUT - what to do? #10

VojtechVitek opened this issue Oct 20, 2015 · 1 comment

Comments

@VojtechVitek
Copy link
Collaborator

Let's say I have 3 stores: Memstore, BoltDB (async) and s3 (async).

given chain.Put(ctx, key, data)

  • Memstore succeeds
  • BoltDB fails
  • s3 succeeds

What should we do? Should we automatically re-try storing the value into the BoltDB again? What if the DB is down for a bit? Should we have a retry queue per Store?

Or since we have LRU, should we have something like PUT down ON DELETE functionality on chain?

@VojtechVitek VojtechVitek changed the title Chain: Underlying Store fails on PUT - what should we do? Chain: Underlying Store fails on PUT - what to do? Oct 20, 2015
@VojtechVitek
Copy link
Collaborator Author

Idea:

err, errCh := chain.Put(ctx, key, value)
if err != nil {
    // handle errors coming from blocking (sync) stores
}
go func() {
      for _, err := range errCh {
            // handle errors coming from async stores
            err.(StoreErr).Retry() // ?
      }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant