--089e0160aab816893f05171d9e22 Content-Type: text/plain; charset=UTF-8
Thank you for the explanation.
Sergej
On Wed, May 27, 2015 at 10:32 AM, Hallvard Breien Furuseth < h.b.furuseth@usit.uio.no> wrote:
On 27/05/15 09:00, sergej.jurecko@gmail.com wrote:
Using a dupsort and writing a large value (which is still bellow maxkeysize) will result in MDB_PAGE_FULL. (...) maxkeysize=10000
Too big MDB_MAXKEYSIZE. Its doc says: "Keys and MDB_DUPSORT data items must fit on a node in a regular page."
But the doc should clarify that MDB_MAXKEYSIZE can be set big enough to break lmdb.
Or mdb_env_open() can fail if the computed me_maxkey would be smaller.
Or compute a safe MIN_PAGESIZE from MDB_MAXKEYSIZE and use that, and then fail if the page size would be unsupported. (MIN_PAGESIZE can be computed at compile time, with some ugly macros.)
lmdb sets the max safe maxkeysize if you define MDB_MAXKEYSIZE=0. Some time ago, that was 1/3 of the size you could reasonably use (to allow 1 key + sub-page with 2 dupsort values), so it could make sense to define MDB_MAXKEYSIZE above the safe max. Today lmdb uses a sub-DB at once if a sub-page would be too small, though. So I don't see much need to support maxkeysize > safe max.
--089e0160aab816893f05171d9e22 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Thank you for the explanation. <br><br><br></div>Serg= ej<br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On We= d, May 27, 2015 at 10:32 AM, Hallvard Breien Furuseth <span dir=3D"ltr"><= ;<a href=3D"mailto:h.b.furuseth@usit.uio.no" target=3D"_blank">h.b.furuseth= @usit.uio.no</a>></span> wrote:<br><blockquote class=3D"gmail_quote" sty= le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 27/= 05/15 09:00, <a href=3D"mailto:sergej.jurecko@gmail.com" target=3D"_blank">= sergej.jurecko@gmail.com</a> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Using a dupsort and writing a large value (which is still bellow=C2=A0 maxk= eysize)<br> will result in MDB_PAGE_FULL.<br> (...)<br> maxkeysize=3D10000<br> </blockquote> <br> Too big MDB_MAXKEYSIZE.=C2=A0 Its doc says:<br> "Keys and MDB_DUPSORT data items must fit on a node in a regular page.= "<br> <br> But the doc should clarify that MDB_MAXKEYSIZE can be set big enough<br> to break lmdb.<br> <br> Or mdb_env_open() can fail if the computed me_maxkey would be smaller.<br> <br> Or compute a safe MIN_PAGESIZE from MDB_MAXKEYSIZE and use that,<br> and then fail if the page size would be unsupported.=C2=A0 (MIN_PAGESIZE<br=
can be computed at compile time, with some ugly macros.)<br> <br> lmdb sets the max safe maxkeysize if you define MDB_MAXKEYSIZE=3D0.<br> Some time ago, that was 1/3 of the size you could reasonably use<br> (to allow 1 key + sub-page with 2 dupsort values), so it could make<br> sense to define MDB_MAXKEYSIZE above the safe max.=C2=A0 Today lmdb<br> uses a sub-DB at once if a sub-page would be too small, though.<br> So I don't see much need to support maxkeysize > safe max.<br> </blockquote></div><br></div>
--089e0160aab816893f05171d9e22--