CoreyKaylor / Lightning.NET

.NET library for LMDB key-value store
Other
397 stars 82 forks source link

Possibly surprising result code returned when doing a Put to a full env #170

Closed placrosse closed 1 month ago

placrosse commented 2 months ago

Update example code in README to show that a Put to a full env will return a Success value, even though the Commit will fail with Map Full, which may be a surprising outcome (though it does match the underlying lmdb behavior). Or, at a minimum, capture and check the returns from both the Put and Commit.

placrosse commented 2 months ago

In other words, receiving a Success return on a single put, even in a simple single-threaded process, is not a guarantee that the Commit will succeed.

Though this does match what LMDB does directly (as this wrapper is passing through the results), showing result codes captured for only the Get (in the main README example), and not the Put nor its corresonding Commit, may point towards different expected behaviors.

Thank you for your work on this language binding.

AlgorithmsAreCool commented 1 month ago

Do you think we should update documentation or the API in this case?

CoreyKaylor commented 1 month ago

I don't think the readme needs to be any different than it is. It's expected that you understand the underlying API and the docs are linked to in the readme.