Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Pass options to rocksdb? #13

Closed
MeirionHughes opened this issue Aug 25, 2017 · 15 comments
Closed

Pass options to rocksdb? #13

MeirionHughes opened this issue Aug 25, 2017 · 15 comments
Labels
enhancement New feature or request help wanted Extra attention is needed semver-minor New features that are backward compatible

Comments

@MeirionHughes
Copy link
Member

MeirionHughes commented Aug 25, 2017

Just testing this library and I noticed there are several Log.old.15036... files being generated.

this post says you can pass options to the c++ library, but don't know how you'd go about doing that with this library (no docs)

Is it possible to configure the number of old log files kept and/or disable logging entirely?

@mcollina
Copy link
Member

I do not know, would you like to send a PR?

@ralphtheninja
Copy link
Member

@MeirionHughes Passing options to the c++ side is not a problem. We just need to figure out what options to pass and document them.

@MeirionHughes
Copy link
Member Author

okay, I'll take a peek if I get the chance and no one else has done it. those log files seem to get fat quickly. :D

@pibi
Copy link

pibi commented Sep 14, 2017

Hi all. I was just looking for a way to pass options to rocksdb too. In my case I need to support openReadOnly for analysis purpose. I found rocksdb-node which support that. Do you think it would be easier to wrap rocksdb-node?

@emschwartz
Copy link

I'm also interested in using the read-only option. Any word on what's the best way to do that? I'd like to keep using this version of rocksdb, if possible, because I really like the compatibility with the levelup/leveldown ecosystem.

@mingoes
Copy link

mingoes commented Dec 25, 2017

+1 for openReadyOnly support! Will try to use rocksdb-node for now.

@oiime
Copy link

oiime commented Jan 29, 2018

+1 for openReadyOnly

@ralphtheninja ralphtheninja added the help wanted Extra attention is needed label Jan 29, 2018
@ralphtheninja
Copy link
Member

Adding it to our project for now so we can at least prioritize it.

@ralphtheninja
Copy link
Member

Is it possible to configure the number of old log files kept and/or disable logging entirely?

@MeirionHughes We should look into how we can disable logging completely. We noticed that it messes up tests (after fixing the destroy-test, we noticed that folders were not deleted on windows). See linked issue.

@MeirionHughes
Copy link
Member Author

MeirionHughes commented Jan 30, 2018

I've forgotten everything about trying this - or even why I tried it (faster maybe? 😆) ... but didn't you need to have "some" log files for restoring state if it corrupts?

@bkniffler
Copy link

Is it possible to add options somehow? readOnly mode would be very cool!

@ralphtheninja
Copy link
Member

@bkniffler It's definitely possible, we just haven't bothered with it yet. Currently focusing on tests and documentations for level as a whole, but we'll get to this as well.

@eugeneware
Copy link
Contributor

For those interested if you change the OpenDatabase function in database.cc to this it will open it up in ReadOnly:

rocksdb::Status Database::OpenDatabase (
        rocksdb::Options* options
    ) {
  return rocksdb::DB::OpenForReadOnly(*options, **location, &db);
}

So we just need to add some node options that call this instead of rocksdb::DB::Open.

@eugeneware
Copy link
Contributor

I've created a PR for this in #98 and also published a personal fork of the leveldown module at @eugeneware/rocksdb

@vweevers
Copy link
Member

Splitting this up:

If there's another option you'd like to see supported, please open a new issue. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed semver-minor New features that are backward compatible
Projects
None yet
Development

No branches or pull requests

10 participants