-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Losing HighestBefore events on shutdown (Vector clock error) #85
Comments
Stacktrace of the panic for reference:
Note: the err occurs during the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vecmt.Index wraps the epoch store database into
VecFlushable
wrapper, which postpones all writes until the Flush() call.Such behavior is correct. (It allows to revert invalid events insertion - only the correct ones are flushed in the
saveAndProcessEvent
method.)However
VecFlushable
in lachesis-base does not flush directly into the backing database, it flushes into its in-memorybackedMap
, which is being flushed to the backing on-disk database only when the map size exceedsIndexConfig.Caches.DBCache
(around 10MiB). This leads to keeping the "HighestBefore" only in the memory even when Opera shuts down, which sometimes leads to following error on the next Opera start:It seems this occur mostly (or maybe only) when "pebble-flg" instead of "pebble-fsh" is being used - probably the fsh transaction avoid writing other db records of the event, so this error does not occur.
In go-opera-norma I have fixed this by creating a new VecFlushable, which flushes directly to the backing database.
The text was updated successfully, but these errors were encountered: