mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-05-28 04:35:57 -04:00
ITS#10054 lmdb: break up large overflow page writes
We were ignoring MAX_WRITE when a single overflow page was larger. Now we guarantee that all writes are <= MAX_WRITE (1GB).
This commit is contained in:
parent
10161b20fe
commit
b0facd0288
1 changed files with 9 additions and 0 deletions
|
|
@ -4198,6 +4198,14 @@ retry_write:
|
|||
wres = pwritev(fd, iov, n, wpos);
|
||||
#else
|
||||
if (n == 1) {
|
||||
while (wsize > MAX_WRITE) {
|
||||
wsize -= MAX_WRITE;
|
||||
wres = pwrite(fd, iov[0].iov_base, MAX_WRITE, wpos);
|
||||
if (wres != MAX_WRITE)
|
||||
goto bad_write;;
|
||||
wpos += MAX_WRITE;
|
||||
iov[0].iov_base += MAX_WRITE;
|
||||
}
|
||||
wres = pwrite(fd, iov[0].iov_base, wsize, wpos);
|
||||
} else {
|
||||
retry_seek:
|
||||
|
|
@ -4213,6 +4221,7 @@ retry_seek:
|
|||
}
|
||||
}
|
||||
#endif
|
||||
bad_write:
|
||||
if (wres != wsize) {
|
||||
if (wres < 0) {
|
||||
rc = ErrCode();
|
||||
|
|
|
|||
Loading…
Reference in a new issue