From 7d246813f7f582fb589714483fdb914624359ba8 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Thu, 2 May 2019 10:45:28 -0700 Subject: [PATCH 1/2] Set the maximum event log size to forty gigabytes. --- pkg/urbit/vere/lmdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/urbit/vere/lmdb.c b/pkg/urbit/vere/lmdb.c index 15f0807bcf..6d3ce6123b 100644 --- a/pkg/urbit/vere/lmdb.c +++ b/pkg/urbit/vere/lmdb.c @@ -41,9 +41,10 @@ MDB_env* u3_lmdb_init(const char* log_path) return 0; } - // TODO: Start with a gigabyte for the event log. + // TODO: Start with forty gigabytes for the maximum event log size. We'll + // need to do something more sophisticated for real in the long term, though. // - ret_w = mdb_env_set_mapsize(env, 1024 * 1024 * 1024); + ret_w = mdb_env_set_mapsize(env, 40 * 1024 * 1024 * 1024); if (ret_w != 0) { u3l_log("lmdb: failed to set database size: %s\n", mdb_strerror(ret_w)); return 0; From c06e8dbdb4ba3c2af8517947f165d9d6c358452e Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Thu, 2 May 2019 10:50:59 -0700 Subject: [PATCH 2/2] Use a typed size_t instead. --- pkg/urbit/vere/lmdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/urbit/vere/lmdb.c b/pkg/urbit/vere/lmdb.c index 6d3ce6123b..8a5fd9d90a 100644 --- a/pkg/urbit/vere/lmdb.c +++ b/pkg/urbit/vere/lmdb.c @@ -44,7 +44,8 @@ MDB_env* u3_lmdb_init(const char* log_path) // TODO: Start with forty gigabytes for the maximum event log size. We'll // need to do something more sophisticated for real in the long term, though. // - ret_w = mdb_env_set_mapsize(env, 40 * 1024 * 1024 * 1024); + const size_t forty_gigabytes = 42949672960; + ret_w = mdb_env_set_mapsize(env, forty_gigabytes); if (ret_w != 0) { u3l_log("lmdb: failed to set database size: %s\n", mdb_strerror(ret_w)); return 0;