Skip to content

PIP-117: Change Pulsar standalone defaults - #15478

Merged
merlimat merged 15 commits into
apache:masterfrom
merlimat:standalone-no-zk
May 24, 2022
Merged

merlimat merged 15 commits into
apache:masterfrom
merlimat:standalone-no-zk

Conversation

@merlimat

@merlimat merlimat commented May 6, 2022

Copy link
Copy Markdown
Contributor

Master Issue: #13302

Motivation

  • Change standalone metadata impl from ZooKeeper to RocksDB

  • Pulsar functions package backend --> Change from using DistributedLog to using local filesystem, storing the
    jars directly in the data folder instead of uploading them into BK.

  • Pulsar functions state store implementation --> Change the state store to be backed by a MetadataStore based backed,
    with the RocksDB implementation.

  • Table Service --> Do not start BK table service by default

@merlimat merlimat added this to the 2.11.0 milestone May 6, 2022
@merlimat merlimat self-assigned this May 6, 2022
@merlimat merlimat added release/note-required doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels May 6, 2022
@apache apache deleted a comment from github-actions Bot May 6, 2022
@codelipenghui

Copy link
Copy Markdown
Contributor

/pulsarbot run-failure-checks

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some thought (I voted the PIP but now that we are close to committing the patch some doibts camento my mind)
Disabling zookeeper by default may have some nasty impact of integration tests of many applications and that run the same test against many versions of Pulsar.

I wonder if there is some easy way, especially for docker users, like passing a single ENV entry of telling Pulsar standalone to run with zookeeper.
It will be quite difficult to support probably but I am now imagining the pain for making integration tests of many applications work with different versions of Pulsar

@Parameter(names = { "-h", "--help" }, description = "Show this help message")
private boolean help = false;

private boolean usingNew211Defaults;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Using version smells a little from my point ofbview.
What about using PIP117 as reference?
usingPIP117Defaults
or we can invert the flag and name it 'useLegscyDefaults' and cite this PIP with a link

private boolean usingNew211Defaults;

public void start() throws Exception {
usingNew211Defaults = !Paths.get(zkDir).toFile().exists();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Os this is true maybe we could log a line explaining that we found the directory and we are switching to the old defaults

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A warning log would be great when both --metadata-dir is provided and zkDir exists.

@Jason918 Jason918 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Left a minor suggestion.

private boolean usingNew211Defaults;

public void start() throws Exception {
usingNew211Defaults = !Paths.get(zkDir).toFile().exists();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A warning log would be great when both --metadata-dir is provided and zkDir exists.

@merlimat

Copy link
Copy Markdown
Contributor Author

Some thought (I voted the PIP but now that we are close to committing the patch some doibts camento my mind) Disabling zookeeper by default may have some nasty impact of integration tests of many applications and that run the same test against many versions of Pulsar.

I wonder if there is some easy way, especially for docker users, like passing a single ENV entry of telling Pulsar standalone to run with zookeeper. It will be quite difficult to support probably but I am now imagining the pain for making integration tests of many applications work with different versions of Pulsar

I'm not sure I'm following here. The external interface of Pulsar does not change whether its metadata is stored in ZK or RocksDb.

I agree though that it's probably a good idea to leave a CLI flag to force the ZK mode, to leave the option open, but that wouldn't be the default.

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm

Thank you!

@merlimat
merlimat merged commit bf194b5 into apache:master May 24, 2022
@merlimat
merlimat deleted the standalone-no-zk branch May 24, 2022 22:36
}

public static boolean isBasedOnZookeeper(String metadataURL) {
if (!metadataURL.contains("://")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@merlimat it seems that metadata url doesn't contains // part?

From the codebase a metadata url to zk is zk:127.0.0.1:2181 and a metadata url to memory is memory:local.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants