Skip to content

Do not create ZK paths if not needed#16816

Merged
kfaraz merged 3 commits intoapache:masterfrom
kfaraz:disable_zk_loading
Aug 6, 2024
Merged

Do not create ZK paths if not needed#16816
kfaraz merged 3 commits intoapache:masterfrom
kfaraz:disable_zk_loading

Conversation

@kfaraz
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz commented Jul 30, 2024

Background

ZK-based segment loading has been completely disabled in #15705 .
ZK servedSegmentsPath has been deprecated since Druid 0.7.1, #1182 .
This legacy path has been replaced by the liveSegmentsPath and is not used in the code anymore.

Other changes

  • Never create ZK loadQueuePath as it is never used.
  • Never create ZK servedSegmentsPath as it is never used.
  • Do not create ZK liveSegmentsPath if announcement on ZK is disabled
  • Fix up tests

Upgrade considerations

Since ZK loadQueuePath will not be created any more by a server, there can be failures while loading
a segment during a rolling upgrade from Druid 29 (or older) to Druid 31.
These failures will happen only if using ZK-based segment loading. A coordinator on an older version
would try to create a ZK node to indicate to a server to load a segment. But the root path would not
exist since (being on a new version) the server would not have created the ZK path at all.

Release notes

  1. ZK-based segment loading has been disabled in Druid 30, Disable ZK-based segment loading, remove usage of skife from DruidCoordinatorConfig #15705.
    In Druid 31, segment serving processes such as Peons, Historicals and Indexers will not create ZK loadQueuePath
    anymore. The property druid.zk.paths.loadQueuePath will be ignored and should not be specified anymore.

When upgrading to Druid 31, the recommended approach is to first move to HTTP-based segment loading
and then perform the version upgrade.

  1. The property druid.zk.paths.servedSegmentsPath is not used anymore and is being removed.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@kfaraz kfaraz changed the title Do not create ZK load queue paths Do not create ZK paths if not needed Jul 30, 2024
true,
Execs.singleThreaded("ZkCoordinator")
);
final String liveSegmentsLocation = ZKPaths.makePath(zkPaths.getLiveSegmentsPath(), me.getName());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [ZkPathsConfig.getLiveSegmentsPath](1) should be avoided because it has been deprecated.
IndexIO.CURRENT_VERSION_ID,
123L
final String liveSegmentsPath = ZKPaths.makePath(
zkPaths.getLiveSegmentsPath(),

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [ZkPathsConfig.getLiveSegmentsPath](1) should be avoided because it has been deprecated.
}
}
if (announceSegmentsOnZk) {
EasyMock.expect(mockCurator.newNamespaceAwareEnsurePath(liveSegmentsPath))

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [CuratorFramework.newNamespaceAwareEnsurePath](1) should be avoided because it has been deprecated.
Copy link
Copy Markdown
Contributor

@AmatyaAvadhanula AmatyaAvadhanula left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, @kfaraz! LGTM

@kfaraz kfaraz merged commit aa49be6 into apache:master Aug 6, 2024
@kfaraz kfaraz deleted the disable_zk_loading branch August 6, 2024 13:59
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants