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

Downgrading ZK to stable version 3.4.13 #2473

Merged
merged 8 commits into from
Sep 6, 2018

Conversation

merlimat
Copy link
Contributor

Motivation

Ensure that we don't have dependency on a ZK version marked as "beta".

Modifications

  • Upgrade to BookKeeper 4.7.2 which includes several bugfixes and removed dependency on ZK-3.5.x
  • Dowgraded ZK to latest stable version 3.4.13 and adapted the AOP wrappers that we had in place for ZK 3.5.x

@merlimat merlimat added this to the 2.1.1-incubating milestone Aug 29, 2018
@merlimat merlimat self-assigned this Aug 29, 2018
Copy link
Contributor

@ivankelly ivankelly left a comment

Choose a reason for hiding this comment

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

implementation lgtm.

However, this needs an integration test, that starts a 3.5 server, creates contains, and uses create2, then rolls back to ensure we can read the log.

Another alternative approach, though with more manual intervention, would be to make the user snapshot the zookeeper instance before upgrade. Could be ropey.

What about users which are sharing the zk instance for something else and are using the container stuff?

@merlimat
Copy link
Contributor Author

However, this needs an integration test, that starts a 3.5 server, creates contains, and uses create2, then rolls back to ensure we can read the log.

Sure. I tested manually so far. I have seen some createContainer txns (/stream/controller) for dlog.

It might be easy to add integration test that starts ZK from pulsar-2.1.0 docker image, writes some stuff and then upgrade to latest image with zk-3.4.x. Tricky part might be the zk-client dependency, but let's see.

Another alternative approach, though with more manual intervention, would be to make the user snapshot the zookeeper instance before upgrade. Could be ropey.

Yes, since we're not actually depending on any of these new txn types, I wanted to have the smoothest downgrade path.

What about users which are sharing the zk instance for something else and are using the container stuff?

I wouldn't worry too much about this case of someone's using Pulsar bundled ZK and expecting it to be 3.5.x for some other applications.

@sijie
Copy link
Member

sijie commented Sep 1, 2018

retest this please

@merlimat
Copy link
Contributor Author

merlimat commented Sep 2, 2018

@ivankelly I have looked into adding integration test. The main problem I think is that since we're using docker based approach for int tests, I haven't found a way to get the container to write data on a mounted volume and then restart with same volume.

@ivankelly
Copy link
Contributor

@merlimat why do you need a mounted volume? You can have more than one version of the pulsar software on a single container, so start a 1.22 zookeeper, for example, write some data, shut it down, then start a 2.0 zookeeper on top of it. The test containers are all configured with supervisord.

@sijie
Copy link
Member

sijie commented Sep 4, 2018

run java8 tests

@merlimat
Copy link
Contributor Author

merlimat commented Sep 5, 2018

@ivankelly @sijie Added integration test with ZK 3.5 snapshot and log

@merlimat
Copy link
Contributor Author

merlimat commented Sep 5, 2018

run java tests

Copy link
Contributor

@ivankelly ivankelly left a comment

Choose a reason for hiding this comment

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

minor comments and questions

for (BrokerContainer brokerContainer : pulsarCluster.getBrokers()) {
brokerContainer.withEnv("managedLedgerMaxEntriesPerLedger", String.valueOf(ENTRIES_PER_LEDGER));
brokerContainer.withEnv("managedLedgerMinLedgerRolloverTimeMinutes", "0");
brokerContainer.withEnv("managedLedgerOffloadDriver", "s3");
Copy link
Contributor

Choose a reason for hiding this comment

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

offload stuff isn't needed.

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

.numBrokers(1)
.clusterName(clusterName)
.classPathVolumeMounts(
ImmutableMap.<String, String> builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is my understanding correct that this will be mounted by all containers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I left it open to not make it ZK specific. In case of other containers the zk data is simply ignored.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, could be a problem if testing multiple zk, but it's fine for now.

.numBrokers(1)
.clusterName(clusterName)
.classPathVolumeMounts(
ImmutableMap.<String, String> builder()
Copy link
Contributor

Choose a reason for hiding this comment

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

The files in this path contain all the new operation types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, added a couple missing now.

@merlimat
Copy link
Contributor Author

merlimat commented Sep 5, 2018

run java8 tests

1 similar comment
@merlimat
Copy link
Contributor Author

merlimat commented Sep 6, 2018

run java8 tests

@sijie
Copy link
Member

sijie commented Sep 6, 2018

@merlimat I think this change will break all the deployment scripts using bin/pulsar zookeeper-shell. see apache/bookkeeper#1660

@merlimat
Copy link
Contributor Author

merlimat commented Sep 6, 2018

It doesn't seem we're using zookeeper-shell tool in helm charts in branch-2.1. Let's merge this and backport to 2.1 and figure out something for 2.2 release.

@merlimat merlimat merged commit d734738 into apache:master Sep 6, 2018
@merlimat merlimat deleted the downgrade-zk branch September 6, 2018 17:58
merlimat added a commit that referenced this pull request Sep 6, 2018
* Downgrading ZK to stable version 3.4.13

* Added integration test for ZK server downgrade

* Fixed ZookeeperClientFactoryImplTest.testZKCreationFailure

* Fixed dependencies version in license file

* Addressed comments

* Fixed jline version in license file

* There are 2 jline jars to count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants