-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[metadata] Add RocksdbMetadataStore #12776
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
Conversation
merlimat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just left few comments
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/api/Notification.java
Outdated
Show resolved
Hide resolved
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/RocksdbMetadataStore.java
Show resolved
Hide resolved
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/RocksdbMetadataStore.java
Outdated
Show resolved
Hide resolved
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/impl/RocksdbMetadataStore.java
Outdated
Show resolved
Hide resolved
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/impl/RocksdbMetadataStoreTest.java
Outdated
Show resolved
Hide resolved
merlimat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
/pulsarbot run-failure-checks |
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I am understand the value for this implementation.
RocksDB is only local, so you could use this mostly only for Pulsar Standalone.
Why should I use RocksDB and not ZooKeeper for Pulsar Standalone ?
Starting RocksDB vs Starting ZooKeeper is not a big difference.
Also we should state clearly that using this implementation is not possible for production usage because each broker will have its own copy of the data, as RocksDB is not a distributed database.
Yes, that's plan. This is one of multi-step work for Pulsar Standalone.
IMHO, in Pulsar Standalone, we already have RocksDb in dependency, so by removing zk from standalone mode, we can make it more lightweight, with less running memory consumption and less time of starting up. Although pulsar standalone is not for production use, it's quite useful and important for offline developing, testing and CI/CD.
Yes, more detailed doc will be added later, since there is some more work to achieve this, like "Bridge BookKeeper metadata into MetadataStore"... @merlimat @codelipenghui @hangc0276 Do we have more detailed doc for this (Removing zk from Pulsar standalone)? |
Why we need to remove zk from pulsar standalone. It can be an option. |
Yes, it's optional. |
Yes, that's the only point of it.
Not really, there is a huge difference in performance and, much more important, in resources usage. Pulsar in Standalone mode is not a distributed system, so it doesn't need any of the feature that ZK provides. |
For general users, it's much better to not use ZK for standalone. The primary role of standalone is not being a (Pulsar) developer tool. |
One can also use Standalone for production, in determined environments, so the distinction here is not very meaningful. The distinction is : distributed vs standalone |
|
@merlimat We already have a metadata interface, so I think |
That's outside the scope of this PR and a full proposal would have to be submitted for this. My short form opinion is:
|
|
@eolivelli Any suggestions about this work? |
| category = CATEGORY_SERVER, | ||
| doc = "Configuration file path for local metadata store. It's supported by RocksdbMetadataStore for now." | ||
| ) | ||
| private String metadataStoreConfigPath = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private String metadataStoreConfigPath = null; | |
| private String rocksDbMetadataStorePath = null; |
WDYT @merlimat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codelipenghui Do you mean rocksDbMetadataStoreConfigPath? This is used for configs. Data store path is defined by metadataURL.
|
@eolivelli PTAL again |
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
But I am against moving to rocksdb as default option to Pulsar Standalone.
This is because with RocksDb it is not possible to connect to the metadatastore and inspect the contents or use other tools (like BK tools).
Standalone is very useful while developing Pulsar and to reproduce bugs and do troubleshooting.
BTW we will have a separate discussion om the ML for sure
* up/master: (75 commits) [website][upgrade]feat: website upgrade / docs migration - 2.5.1 Get Started/Concepts and Architecture/Pulsar Schema (apache#13030) Fix environment variable assignment in startup scripts (apache#13025) update 2.8.x (apache#13029) [Doc] add tips for Pulsar tools (apache#13044) Suggest to use tlsPort instead of deprecated TlsEnable (apache#13039) Integration tests for function-worker rebalance and drain operations. (apache#13058) fix(functions): missing runtime set in GoInstanceConfig (apache#13031) [pulsar-admin] Add get-replicated-subscription-status command for topic (apache#12891) [Broker] Consider topics in pulsar/system namespace as system topics (apache#13050) Fix typo: correct sizeUint to sizeUnit (apache#13040) fix-12894 (apache#12896) Don't attempt to delete pending ack store unless transactions are enabled (apache#13041) [Perf] Evaluate the current protocol version once (apache#13045) Fix Issue apache#12885, Unordered consuming case in Key_Shared subscription (apache#12890) [broker]Optimize topicMaxMessageSize with topic local cache. (apache#12830) [PIP-105] Part-2 Support pluggable entry filter in Dispatcher (apache#12970) [website] Modify admin-api-topic.md document (apache#12996) add missed import (apache#13037) [metadata] Add RocksdbMetadataStore (apache#12776) [C] Add pulsar_client_subscribe_multi_topics and pulsar_client_subscribe_pattern (apache#12965) ... # Conflicts: # site2/website-next/docusaurus.config.js # site2/website-next/versioned_sidebars/version-2.6.1-sidebars.json # site2/website-next/versions.json
|
I just have a question. When we use RocksDB as Pulsar standalone's metadata store, how do we check the metadata like we did via |
There is a PIP for this. See #13346 |
Motivation
Add Metadata Store implemented with rocksdb.
This is part of the work to remove zk from standalone server. All metadata can be stored in rocksdb.
Modifications
Add Metadata Store implemented with rocksdb.
Verifying this change
This change is already covered by existing tests, such as each test class extends
BaseMetadataStoreTestThis change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
no-need-docNot ready for user yet.