unsigned env_flag;
+static unsigned lmdb_page_size(knot_lmdb_db_t *db)
+{
+ knot_lmdb_txn_t txn = { 0 };
+ knot_lmdb_begin(db, &txn, false);
+ MDB_stat st = { 0 };
+ mdb_stat(txn.txn, txn.db->dbi, &st);
+ knot_lmdb_abort(&txn);
+ return st.ms_psize;
+}
+
static void set_conf(int zonefile_sync, size_t journal_usage, const knot_dname_t *apex)
{
(void)apex;
list_t l;
// allow merge
- set_conf(-1, 100 * 1024, apex);
+ set_conf(-1, 400 * 1024, apex);
ok(!journal_allow_flush(jj), "journal: merge allowed");
ret = journal_scrape_with_md(jj, false);
// now fill up with dumy changesets to enforce merge
tm_chs(apex, -1);
while (changeset_to(tm_chs(apex, 0)) != 2) { }
- for (i = 0; i < 400; i++) {
+ for (i = 0; i < 1600; i++) {
ret = journal_insert(jj, tm_chs(apex, i), NULL);
assert(ret == KNOT_EOK);
}
test_store_load(apex);
- test_size_control(apex, apex2);
+ if (lmdb_page_size(&jdb) == 4096) {
+ test_size_control(apex, apex2);
+ } // else it is not manually optimized enough to test correctly
test_merge(apex);