Skip to content

Commit 4e5636a

Browse files
committed
More debugging on flush error
1 parent 702af28 commit 4e5636a

File tree

1 file changed

+7
-3
lines changed
  • dependencies/lmdb/libraries/liblmdb

1 file changed

+7
-3
lines changed

dependencies/lmdb/libraries/liblmdb/mdb.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,15 +2601,17 @@ mdb_page_spill(MDB_cursor *m0, MDB_val *key, MDB_val *data)
26012601
mdb_midl_sort(txn->mt_spill_pgs);
26022602

26032603
/* Flush the spilled part of dirty list */
2604-
if ((rc = mdb_page_flush(txn, i)) != MDB_SUCCESS)
2604+
if ((rc = mdb_page_flush(txn, i)) != MDB_SUCCESS) {
2605+
fprintf(stderr, "mdb_page_spill flushing error %i\n", rc);
26052606
goto done;
2607+
}
26062608

26072609
/* Reset any dirty pages we kept that page_flush didn't see */
26082610
rc = mdb_pages_xkeep(m0, P_KEEP, i);
26092611

26102612
done:
26112613
if (rc) {
2612-
fprintf(stderr, "mdb_page_spill error\n");
2614+
fprintf(stderr, "mdb_page_spill error %i\n", rc);
26132615
}
26142616
txn->mt_flags |= rc ? MDB_TXN_ERROR : MDB_TXN_SPILLS;
26152617
return rc;
@@ -4609,7 +4611,9 @@ mdb_page_flush(MDB_txn *txn, int keep)
46094611
rc = ErrCode();
46104612
if (rc == EINTR)
46114613
goto retry_write;
4612-
fprintf(stderr, "Write error: %s", strerror(rc));
4614+
fprintf(stderr, "Write error: %s position %u, size %u", strerror(rc), wpos, wsize);
4615+
last_error = malloc(100);
4616+
sprintf(last_error, "Attempting to write page at position %u, size %u", wpos, wsize);
46134617
} else {
46144618
rc = EIO; /* TODO: Use which error code? */
46154619
DPUTS("short write, filesystem full?");

0 commit comments

Comments
 (0)