Skip to content

refactor: remove zookeeper segment announcement and discovery#19377

Open
clintropolis wants to merge 5 commits intoapache:masterfrom
clintropolis:remove-some-zk-stuff
Open

refactor: remove zookeeper segment announcement and discovery#19377
clintropolis wants to merge 5 commits intoapache:masterfrom
clintropolis:remove-some-zk-stuff

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Description

Druid has carried both ZooKeeper- and HTTP-based paths for segment announcement and inventory for several releases. The ZK paths have been @Deprecated for years, off by default (druid.serverview.type=http is the default), and segment-publishing path, the ZK-based inventory view, and the now-orphaned ZkCoordinator / DataSegmentServerAnnouncer / CuratorDataSegmentServerAnnouncer.

After this change, ZooKeeper's responsibilities in Druid are limited to:

  1. Coordinator and Overlord leader election
  2. Service (node) announcement and discovery
  3. Overlord / MiddleManager task management (out of scope for this PR; but will look to remove this too in a follow-up)

BatchDataSegmentAnnouncer seems a lot nicer now since it only has to track change history for the lister resource, to something better in a follow-up, but skipped for now.

Release note

ZooKeeper-based segment announcement and discovery removed

The ZooKeeper-based segment announcement and inventory view, which have been deprecated and off by default for several releases, have been removed. The HTTP-based path (the default for druid.serverview.type=http) is now the only supported option.

If your configuration sets druid.serverview.type to anything other than http, startup will now fail with a clear error message. Remove the property (or set it to http, which is the default) to proceed.

The following configuration properties are no longer recognized and should be removed from common.runtime.properties:

  • druid.announcer.segmentsPerNode
  • druid.announcer.maxBytesPerNode
  • druid.announcer.skipLoadSpec
  • druid.announcer.skipDimensionsAndMetrics
  • druid.announcer.skipSegmentAnnouncementOnZk
  • druid.zk.paths.liveSegmentsPath
  • druid.zk.paths.propertiesPath
  • druid.zk.paths.connectorPath

ZooKeeper is still used for leader election, service (node) announcement and discovery, and Overlord-to-MiddleManager task management.

Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

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

The changes LGTM, no correctness issues found.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

👍 on the removal. I think a few too many tests got removed, as mentioned in line comments. Beyond that there's a couple of references that could also be removed:

  • in docs/configuration/logging.md, the example log file mentions BatchServerInventoryView which doesn't exist anymore
  • in MainTest there is a setting of druid.serverview.type = batch in one of the tests. It's expecting an exception to be thrown. I believe it's now passing for a different reason than intended.

import java.util.concurrent.Executor;
import java.util.stream.Collectors;

public class BrokerServerViewTest extends CuratorTestBase
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.

There's coverage of BrokerServerView in this test that we should preserve, such as testing for handling of tiers, etc. It should be reworked to use some other base view.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

oops, restored, thanks for catching

import java.util.concurrent.ExecutorService;

@RunWith(Parameterized.class)
public class CoordinatorServerViewTest extends CuratorTestBase
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.

Like BrokerServerView, the tests here should be reworked to use some other base view.

/**
*
*/
public class BatchDataSegmentAnnouncerTest
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 of the removed tests in this file look like they are testing functionality that still exists, so they should be restored. Including:

  • testAnnounceSegmentWithSameSegmentConcurrently
  • testAnnounceSegmentsWithSameSegmentConcurrently
  • testSchemaAnnounce

Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

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

The changes LGTM, no correctness issues found.

Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

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

The changes LGTM, no correctness issues found.

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.

3 participants