From db7aaf10af649c180038dffdc1eeef2520f77525 Mon Sep 17 00:00:00 2001 From: zhibinr Date: Thu, 12 Mar 2015 18:50:22 +0800 Subject: [PATCH 1/3] fix a typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35558a3..0c72952 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ LedisDB now supports multiple different databases as backends. + Rich data structure: KV, List, Hash, ZSet, Set. + Data storage is not limited by RAM. + Various backends supported: LevelDB, goleveldb, LMDB, RocksDB, BoltDB, RAM. -+ Supports transactions using LMDB or BotlDB. ++ Supports transactions using LMDB or BoltDB. + Supports Lua scripting. + Supports expiration and TTL. + Can be managed via redis-cli. From 62124c233dd0f0c7762261399db4b1a9225585c1 Mon Sep 17 00:00:00 2001 From: siddontang Date: Fri, 13 Mar 2015 11:18:47 +0800 Subject: [PATCH 2/3] bugfix for flushall --- ledis/ledis.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ledis/ledis.go b/ledis/ledis.go index c28c29b..0bd4526 100644 --- a/ledis/ledis.go +++ b/ledis/ledis.go @@ -131,6 +131,8 @@ func (l *Ledis) flushAll() error { it := l.ldb.NewIterator() defer it.Close() + it.SeekToFirst() + w := l.ldb.NewWriteBatch() defer w.Rollback() From 09d57e28f62f0806d58531cd456bf5c0cf02ef0c Mon Sep 17 00:00:00 2001 From: siddontang Date: Fri, 13 Mar 2015 14:00:33 +0800 Subject: [PATCH 3/3] use 16 now for later refactor I will try to support large db index for xcodis --- config/config.go | 4 ++-- config/config.toml | 2 +- etc/ledis.conf | 4 ++-- ledis/ledis.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 61d4519..8567b76 100644 --- a/config/config.go +++ b/config/config.go @@ -215,8 +215,8 @@ func (cfg *Config) adjust() { cfg.ConnWriteBufferSize = getDefault(4*KB, cfg.ConnWriteBufferSize) cfg.TTLCheckInterval = getDefault(1, cfg.TTLCheckInterval) cfg.Databases = getDefault(0, cfg.Databases) - if cfg.Databases > 256 { - cfg.Databases = 256 + if cfg.Databases > 16 { + cfg.Databases = 16 } } diff --git a/config/config.toml b/config/config.toml index bcc3820..0b965f5 100644 --- a/config/config.toml +++ b/config/config.toml @@ -11,7 +11,7 @@ data_dir = "/tmp/ledis_server" # Set the number of databases. You can use `select dbindex` to choose a db. # dbindex must be in [0, databases - 1]. -# Maximum databases is 256. +# Maximum databases is 16 now. databases = 16 # Log server command, set empty to disable diff --git a/etc/ledis.conf b/etc/ledis.conf index 9c34182..0b965f5 100644 --- a/etc/ledis.conf +++ b/etc/ledis.conf @@ -11,8 +11,8 @@ data_dir = "/tmp/ledis_server" # Set the number of databases. You can use `select dbindex` to choose a db. # dbindex must be in [0, databases - 1]. -# Maximum databases is 256. -databases = 256 +# Maximum databases is 16 now. +databases = 16 # Log server command, set empty to disable access_log = "" diff --git a/ledis/ledis.go b/ledis/ledis.go index 0bd4526..60c06a2 100644 --- a/ledis/ledis.go +++ b/ledis/ledis.go @@ -45,8 +45,8 @@ func Open(cfg *config.Config) (*Ledis, error) { if cfg.Databases == 0 { cfg.Databases = 16 - } else if cfg.Databases > 256 { - cfg.Databases = 256 + } else if cfg.Databases > 16 { + cfg.Databases = 16 } os.MkdirAll(cfg.DataDir, 0755)