mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:14:12 +08:00
mdbx-chk: "backed-pages > file-pages" isn't error in the non-exclusive or read-only modes.
This commit is contained in:
parent
bceace7a09
commit
7960f67ea6
@ -1020,7 +1020,7 @@ int main(int argc, char *argv[]) {
|
|||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
rc == ERROR_LOCK_VIOLATION || rc == ERROR_SHARING_VIOLATION
|
rc == ERROR_LOCK_VIOLATION || rc == ERROR_SHARING_VIOLATION
|
||||||
#else
|
#else
|
||||||
rc == EBUSY
|
rc == EBUSY || rc == EAGAIN
|
||||||
#endif
|
#endif
|
||||||
)) {
|
)) {
|
||||||
envflags &= ~MDBX_EXCLUSIVE;
|
envflags &= ~MDBX_EXCLUSIVE;
|
||||||
@ -1109,7 +1109,8 @@ int main(int argc, char *argv[]) {
|
|||||||
alloc_pages = txn->mt_next_pgno;
|
alloc_pages = txn->mt_next_pgno;
|
||||||
backed_pages = envinfo.mi_geo.current / envinfo.mi_dxb_pagesize;
|
backed_pages = envinfo.mi_geo.current / envinfo.mi_dxb_pagesize;
|
||||||
#if !(defined(_WIN32) || defined(_WIN64))
|
#if !(defined(_WIN32) || defined(_WIN64))
|
||||||
if ((envflags & MDBX_EXCLUSIVE) && backed_pages != dxbfile_pages) {
|
if ((envflags & (MDBX_EXCLUSIVE | MDBX_RDONLY)) != MDBX_RDONLY &&
|
||||||
|
backed_pages != dxbfile_pages) {
|
||||||
print(" ! backed-pages %" PRIu64 " != file-pages %" PRIu64 "\n",
|
print(" ! backed-pages %" PRIu64 " != file-pages %" PRIu64 "\n",
|
||||||
backed_pages, dxbfile_pages);
|
backed_pages, dxbfile_pages);
|
||||||
++problems_meta;
|
++problems_meta;
|
||||||
@ -1127,18 +1128,36 @@ int main(int argc, char *argv[]) {
|
|||||||
++problems_meta;
|
++problems_meta;
|
||||||
backed_pages = MAX_PAGENO;
|
backed_pages = MAX_PAGENO;
|
||||||
}
|
}
|
||||||
if (backed_pages > dxbfile_pages) {
|
|
||||||
print(" ! backed-pages %" PRIu64 " > file-pages %" PRIu64 "\n",
|
|
||||||
backed_pages, dxbfile_pages);
|
|
||||||
++problems_meta;
|
|
||||||
backed_pages = dxbfile_pages;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alloc_pages > backed_pages) {
|
if ((envflags & (MDBX_EXCLUSIVE | MDBX_RDONLY)) != MDBX_RDONLY) {
|
||||||
print(" ! alloc-pages %" PRIu64 " > backed-pages %" PRIu64 "\n",
|
if (backed_pages > dxbfile_pages) {
|
||||||
alloc_pages, backed_pages);
|
print(" ! backed-pages %" PRIu64 " > file-pages %" PRIu64 "\n",
|
||||||
++problems_meta;
|
backed_pages, dxbfile_pages);
|
||||||
alloc_pages = backed_pages;
|
++problems_meta;
|
||||||
|
backed_pages = dxbfile_pages;
|
||||||
|
}
|
||||||
|
if (alloc_pages > backed_pages) {
|
||||||
|
print(" ! alloc-pages %" PRIu64 " > backed-pages %" PRIu64 "\n",
|
||||||
|
alloc_pages, backed_pages);
|
||||||
|
++problems_meta;
|
||||||
|
alloc_pages = backed_pages;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* LY: DB may be shrinked by writer downto the allocated pages. */
|
||||||
|
if (alloc_pages > backed_pages) {
|
||||||
|
print(" ! alloc-pages %" PRIu64 " > backed-pages %" PRIu64 "\n",
|
||||||
|
alloc_pages, backed_pages);
|
||||||
|
++problems_meta;
|
||||||
|
alloc_pages = backed_pages;
|
||||||
|
}
|
||||||
|
if (alloc_pages > dxbfile_pages) {
|
||||||
|
print(" ! alloc-pages %" PRIu64 " > file-pages %" PRIu64 "\n",
|
||||||
|
alloc_pages, dxbfile_pages);
|
||||||
|
++problems_meta;
|
||||||
|
alloc_pages = dxbfile_pages;
|
||||||
|
}
|
||||||
|
if (backed_pages > dxbfile_pages)
|
||||||
|
backed_pages = dxbfile_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user