Bug 1539622 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Nan Jiang [:nanj] from comment #0)
> Looks like the first option is more reasonable for now, as the second one would be unnecessary once the auto-resizing is implemented in rkv.

Over in bug 1538093, I'm adding support for cert_storage to re-open its environment in read-only mode after initial creation and then re-open it in read-write mode temporarily when making changes.  After that lands, it should be reasonably straightforward to re-open the environment with a larger map size and re-try a write if it initially results in a "MapFull" error.

Whether it makes sense to do that depends on how soon we expect to land auto-resizing, however.  If auto-resizing is going to happen soon, then I agree that the first option is more reasonable.  Nan, do you have a sense of how long it'll take to complete the auto-resizing work?

(In reply to Nan Jiang [:nanj] from comment #3)
> LMDB usually recommends leaving enough space for the potential increase (e.g. 150% of your estimate). It won't occupy any disk space (more like a placeholder) until the data gets inserted.

That's true on Mac/Linux, but on Windows it creates a file at the map size, so we should take that into account when choosing the map size for an environment.  See https://github.com/mozilla/lmdb-rs/issues/40 for more info on why it does this and we could do to grow the file size incrementally on Windows.
(In reply to Nan Jiang [:nanj] from comment #0)
> Looks like the first option is more reasonable for now, as the second one would be unnecessary once the auto-resizing is implemented in rkv.

Over in bug 1538093, I'm adding support for cert_storage to re-open its environment in read-only mode after initial creation and then re-open it in read-write mode temporarily when making changes.  After that lands, it should be reasonably straightforward to re-open the environment with a larger map size and re-try a write if it initially results in a "MapFull" error.

Whether it makes sense to do that depends on how soon we expect to land auto-resizing, however.  If auto-resizing is going to happen soon, then I agree that the first option is more reasonable.  Nan, do you have a sense of how long it'll take to complete the auto-resizing work?

(In reply to Nan Jiang [:nanj] from comment #3)
> LMDB usually recommends leaving enough space for the potential increase (e.g. 150% of your estimate). It won't occupy any disk space (more like a placeholder) until the data gets inserted.

That's true on Mac/Linux, but on Windows it creates a file at the map size, so we should take that into account when choosing the map size for an environment.  See https://github.com/mozilla/lmdb-rs/issues/40 for more info on why it does this and what we could do to grow the file size incrementally on Windows.

Back to Bug 1539622 Comment 4