Skip to content
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

Figuring out when PersistentDictionary is flushed to disk #17

Open
Astralking opened this issue Jan 24, 2019 · 1 comment
Open

Figuring out when PersistentDictionary is flushed to disk #17

Astralking opened this issue Jan 24, 2019 · 1 comment

Comments

@Astralking
Copy link

Astralking commented Jan 24, 2019

So we have been having an issue in production with user sessions not being present in the PersistentDictionary after an obscure exception crashed the API.

After exhausting almost every avenue possible the only thing I'm left with is that whatever changes are made to the dictionary do not have a chance to be persisted to disk before the process Is terminated. Is there any way to tell, via logging or otherwise, when a none manual flush occurs? Please correct me if this isn't how it works but that's what I gather from the docs.

Thanks in advance

@michaelthorp
Copy link
Contributor

You are likely correct in what is happening. PersistentDictionary uses lazy transactions (i.e. specifies the CommitTransactionGrbit.LazyFlush, which returns before it flushes the transaction to the log file. So a crash before this flush may lose whatever was not flushed.

The underlying database (ESENT) does have an option to do a callback when a flush to log happens, but PersistentDictionary does not use the callbacks.

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

No branches or pull requests

2 participants