Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use bloom filter, add event listener to collect stats of compaction, improve update rocksdb options #1959

Merged
merged 4 commits into from
Mar 27, 2020

Conversation

critical27
Copy link
Contributor

@critical27 critical27 commented Mar 24, 2020

  1. Use bloom filter by default
  2. Add some options to open partitioned index/filter
  3. Add a EventListener to collect stats of compaction.
  4. Improve udpate rocksdb configs, for those options which can't change dynamically, it would take effect after reboot.

@Amber1990Zhang, would you help to update the doc configs-syntax, because some options is not supported anymore, thx.

close #1966

namespace nebula {
namespace kvstore {

class EventListener : public rocksdb::EventListener {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job

@@ -28,7 +28,7 @@ DEFINE_uint64(raft_snapshot_timeout, 60 * 5, "Max seconds between two snapshot r

DEFINE_uint32(max_batch_size, 256, "The max number of logs in a batch");

DEFINE_int32(wal_ttl, 86400, "Default wal ttl");
DEFINE_int32(wal_ttl, 14400, "Default wal ttl");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current is 4 hour ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current is 1 day, @whitewum suggest change it shorter.

@@ -87,6 +91,15 @@ rocksdb::Status initRocksdbOptions(rocksdb::Options &baseOpts) {
static std::shared_ptr<rocksdb::Cache> blockCache
= rocksdb::NewLRUCache(FLAGS_rocksdb_block_cache * 1024 * 1024);
bbtOpts.block_cache = blockCache;
bbtOpts.filter_policy.reset(rocksdb::NewBloomFilterPolicy(10, false));
if (FLAGS_enable_partitioned_index_filter) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about add prefix bloom filter? for the prefix 12bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Later I will check if it improves perf.

@critical27 critical27 added the ready-for-testing PR: ready for the CI test label Mar 25, 2020
@critical27 critical27 changed the title use bloom filter, add event listener to collect stats of compaction use bloom filter, add event listener to collect stats of compaction, improve update rocksdb options Mar 25, 2020
@@ -14,7 +14,7 @@ std::unordered_set<std::string> SetConfigProcessor::mutableFields_ = {
// rocksdb_column_family_options
"disable_auto_compactions",
// TODO: write_buffer_size will cause rocksdb crash
// "write_buffer_size",
"write_buffer_size",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"write_buffer_size" works well now ? if yes , do we need to uncomment in MetaServerBasedPartManager::onSpaceOptionUpdated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"write_buffer_size" works well now ? if yes , do we need to uncomment in MetaServerBasedPartManager::onSpaceOptionUpdated?

Sorry, the comment has been removed. I'm wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to remove the TODO : )

Copy link
Contributor

@bright-starry-sky bright-starry-sky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work, I learned some new skills.
LGTM.

@@ -160,7 +164,7 @@ Status Configuration::fetchAsSubConf(const char *key, Configuration &subconf) co
}


Status Configuration::updateStringField(const char* key, const std::string& val) {
Status Configuration::upsertStringField(const char* key, const std::string& val) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question, Why naming upsert?
What I understand that upsert is : should be override the old value if key exists; should be insert a new value if the key doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, so we can insert some option which doesn't exists, and update some option with a new value. The function actually is a upsert, a bad name.

"level0_file_num_compaction_trigger",
"level0_slowdown_writes_trigger",
"level0_stop_writes_trigger",
"target_file_size_base",
"target_file_size_multiplier",
"max_bytes_for_level_base",
"max_bytes_for_level_multiplier",
"ttl",
"block_size",
"block_restart_interval"
};
static std::unordered_set<std::string> supportedDbOpt = {
"max_total_wal_size",
"delete_obsolete_files_period_micros",
"max_background_jobs",
Copy link
Contributor

@dangleptr dangleptr Mar 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support max_subcompactions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can't be changed dynamically, for those options, it would take effect when reboot.

@critical27 critical27 requested a review from amber-moe March 26, 2020 03:44
Copy link
Contributor

@dangleptr dangleptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. LGTM.
Thanks for taking care of it.

Copy link
Contributor

@darionyaphet darionyaphet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Work

@whitewum whitewum added this to the R201910_RC4 milestone Mar 27, 2020
@dangleptr dangleptr merged commit 249b46c into vesoft-inc:master Mar 27, 2020
@amber-moe amber-moe self-assigned this Mar 31, 2020
dangleptr added a commit that referenced this pull request Apr 1, 2020
* Upgrade rocksdb to 6.7.3 (#1948)

Co-authored-by: heng <[email protected]>
Co-authored-by: yaphet <[email protected]>

* Detect OS type and exit if not built in Linux (#1951)

* Detect OS type and exit if not built in Linux

Signed-off-by: JaySon-Huang <[email protected]>

* Disable for FreeBSD

Signed-off-by: JaySon-Huang <[email protected]>

* [doc] user-permission-mng (#1929)

* alter user & change psw

* built in roles

* cbs comments

* fix comments

* update table

* addenable_authorize doc

* [doc] ttl doc modification (#1939)

* ttl doc modification

* fix comments

* yt comments

* silver days comments

* timestamp update

* Let action not fail fast. (#1909)

* Let action not fail fast.

* Disable the ci will product artifact.

* Remove removePrefix interface in kvstore (#1953)

Co-authored-by: heng <[email protected]>
Co-authored-by: yaphet <[email protected]>

* using admin client in MetaServiceHandler (#1864)

* [doc] fix typo (#1954)

* [doc]show statements (#1924)

* [doc]customized dir (#1906)

* Fixed a bug caused by not filtering the versions of edges (#1962)

* Fixed a bug caused by not filtering the versions of edges when executing "go from vid over *".

* address CPWstatic's comment.

* Modify the listEdges interface and add parameters to directly return all latest versions of edges.

* address laura's comment.

Co-authored-by: dutor <[email protected]>

* [doc]modify job manger doc (#1957)

* modify job manger doc

* add flush

Co-authored-by: dutor <[email protected]>

* Fix delete verticse (#1970)

* Fix the read performance issue after delete range with rocksdb-5.15.10 (#1973)

* Fix the read performace issue after delete range with rocksdb-5.15.10

* Fix the move issue

* fix the move issue

* Rebase and address bright-starry-sky's comments

Co-authored-by: heng <[email protected]>

* Remove the LOG(FATAL) when encounting the unknown log type (#1978)

* 1,Improve customer friendliness; 2, fixed typo error (#1980)

* upgrade spark download address (#1981)

Co-authored-by: dutor <[email protected]>

* fix-typo-in-doc (#1976)

Co-authored-by: dutor <[email protected]>

* modify commands in build doc (#1969)

Co-authored-by: dutor <[email protected]>

* modify log level (#1945)

Co-authored-by: dangleptr <[email protected]>
Co-authored-by: dutor <[email protected]>

* use bloom filter, add event listener to collect stats of compaction, improve update rocksdb options (#1959)

* open bloom filter in default conf, add event listener to collect stats of compaction

* imporve update rocksdb configs

* fix ut error

Co-authored-by: yaphet <[email protected]>

* Update the interface atomicOp to support empty string (#2002)

Co-authored-by: heng <[email protected]>
Co-authored-by: Doodle <[email protected]>

* update to rc4 (#1968)

Co-authored-by: dutor <[email protected]>

* Fixed if you execute "go from xx over *", and when there is no edge under a space, (#1983)

an unreasonable error message is returned (SpaceId `xxx 'is nonexistent)

Co-authored-by: dutor <[email protected]>

* [doc]pr-commit-msg (#1993)

* pr-commit-msg

* add examples

Co-authored-by: dutor <[email protected]>

* doc:modify ttl query (#2006)

Co-authored-by: dutor <[email protected]>

* Let merge coverage report faster by fastcov instead of lcov. (#1943)

Co-authored-by: dutor <[email protected]>

* Auto check keyword (#1922)

* Supports the detection keyword, name_label supports string

* add tests

* address Shylock's comment

* modify  to add reserved keyword

Co-authored-by: dutor <[email protected]>

* Fix coredump for update if encountering bad format row (#2024)

Co-authored-by: heng <[email protected]>
Co-authored-by: bright-starry-sky <[email protected]>

* fixed loop depend problem for compile link (#1995)

* fixed loop depend problem

* fixed error for clang9 and gcc9

* Addressed laura-ding's comment

* Check all reader is null or not before using it (#2029)

* fix go without yield return errror result (#2012)

* fix go without yield return errror result

* fix format

* address dangleptr's comment

* address issue change TTL_DURATION not negative

* add onlyStructure is true test case

Co-authored-by: bright-starry-sky <[email protected]>

* fixed bug for delete vertex without edge (#2001)

* When deleting a vertex, if the edge does not exist,
then we should continue to delete the vertex instead of reporting an error.

* added the testcase for delete vertex without edge.

* add alias for lookup (#2000)

* fix bug 1990/1991 (#2007)

* 1. meta client sub mit job only to leader 2. sort jobs in desc id order

* now show jobs return in desc order, adjust UT

Co-authored-by: dangleptr <[email protected]>

* upload package to oss (#1972)

* upload oss

* update

* Remove redundant

* address @yixinlu's comment

Co-authored-by: dutor <[email protected]>

Co-authored-by: dangleptr <[email protected]>
Co-authored-by: heng <[email protected]>
Co-authored-by: yaphet <[email protected]>
Co-authored-by: JaySon <[email protected]>
Co-authored-by: Amber Zhang <[email protected]>
Co-authored-by: Shylock Hg <[email protected]>
Co-authored-by: Simon Liu <[email protected]>
Co-authored-by: dutor <[email protected]>
Co-authored-by: bright-starry-sky <[email protected]>
Co-authored-by: Liuxue-Yang <[email protected]>
Co-authored-by: laura-ding <[email protected]>
Co-authored-by: Doodle <[email protected]>
Co-authored-by: panda-sheep <[email protected]>
Co-authored-by: liuyu85cn <[email protected]>
@critical27 critical27 deleted the conf branch May 14, 2020 08:00
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
…improve update rocksdb options (vesoft-inc#1959)

* open bloom filter in default conf, add event listener to collect stats of compaction

* imporve update rocksdb configs

* fix ut error

Co-authored-by: yaphet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some rocksdb option wrong, storaged upgrade and can't start
6 participants