byzhang / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Db::Open() takes a long time #220

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We have a heavily used database, which stores 100G+ data, and is frequently 
updated. When we close and reopen the database, it takes up to hours to open it.

Is it possible to config(Options) to make Db::Open() returns quickly?

What steps will reproduce the problem?
1. Open a database
2. Doing a lot Sets/Deletes...
3. Close data
4. Reopen it(Db::Open())

What is the expected output? What do you see instead?

Expecting Db::Open() returns within one second. But it blocks for an hour.

What version of the product are you using? On what operating system?

1.14

Please provide any additional information below.

Original issue reported on code.google.com by wuzuy...@gmail.com on 8 Dec 2013 at 2:51

GoogleCodeExporter commented 9 years ago
I had a similar issue but in small scale, see 
https://groups.google.com/forum/#!topic/leveldb/cAUHHY2MrNk and the reason is 
that leveldb automatically compacts on Open(). To avoid this, 
CompactRange(NULL, NULL) can before used before closing the db.

Original comment by mee...@gmail.com on 9 Dec 2013 at 8:02