Skip to content

Missing metadata-store watch events #11153

@bharanic-dev

Description

@bharanic-dev

Describe the bug
When a metadata-store resource is updated repeatedly via the admin command, some times watch events get missed.

To Reproduce
The issue can be reproduced by executing the unit test in the commit below.

bharanic-dev@e518245

The test registers a metadata-store callback for 'resourceGroup' and creates a 'resourceGroup' via the admin API. The 'resourceGroup' is later updated repeatedly in a loop. At the end, the test asserts that the final value read in the 'watch callback' is the same as the value that was set in the final update via admin API.

Execute the test either in an IDE or via mvn(using the following command):
mvn test -Dtest=org.apache.pulsar.broker.resourcegroup.ResourceGroupConfigListenerTest#testResourceGroupUpdateLoop -pl pulsar-broker

If the loop is executed a small number of times (10 or less), the test fails intermittently. As the number of times the loop is executed is increased (20 or more), the test tends to fail more frequently.

Expected behavior
The unit test should succeed.

Desktop (please complete the following information):

  • OS: MAC OS
  • IDE: intellij
  • mvn command line

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions