[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7651) LMDB: Uncontrolled database when opened from multiple processes



Howard Chu writes:
> h.b.furuseth@usit.uio.no wrote:
>> I'd call this two doc bugs:
>>
>> Something should mention that once a page has been used, the file will
>> never shrink below that page.  (Can't quite say that the file never
>> shrinks, since WRITEMAP and Windows will set it to exact re-configurable
>> mapsize in some cases.  If I remember correctly.)
> 
> You cannot shrink the mapsize below that last used page, and the last used 
> page is a non-decreasing number.

Yes.  Duh, that's already roughly stated under mdb_env_set_mapsize().

>> mdb_env_copy() and mdb_env_copyfd() should document that
>>
>>    @node This call can trigger siginficant file size growth if run in
>>    parallel with write transactions, because it employs a read-only
>>    transaction. See long-lived transactions under Caveats.

I'll add this one though.

>> I wonder that means these functions should have a flag parameter.
>> For some databases, users might prefer a _write_ transaction while
>> reading the DB, blocking writes while copying.
> 
> No one has ever wanted a hot-backup function that halts writes. You
> might as well not do a hot-backup at all.

Yes, nevermind about a mdb_env_copy() flag.  An mdb_txn_begin
timeout would make it a viable choice - but if that is implemented
someday, those two behaviors together could go in an MDB_env flag.

-- 
Hallvard