GreanTech / AtomEventStore

A server-less .NET Event Store based on the Atom syndication format
MIT License
117 stars 14 forks source link

Update of last link should silently fail #96

Closed ploeh closed 9 years ago

ploeh commented 9 years ago

As discussed in #48, when a new page is created, the second of two update operations may fail, which means that the index document's last link becomes stale. The system is still 'almost consistent' in the sense that all other links point to correct documents, apart from the last link in the index document. This link points to an existing document, but that document is no longer the most recent document.

However, if the update operation of the index throws an exception, a client may interpret that as a failure to write an event to storage, and thus may retry the operation. This would be an error, because the event has been written, and thus, a duplicate event would be written if the operation is retried.

For that reason, while the first update operation (of the new previous page) must succeed or throw an exception, the second update (of the index page) must silently fail if an error occurs.