Skip to content

Handle nulls in DruidCoordinator.getReplicationFactor#14447

Merged
kfaraz merged 2 commits intoapache:masterfrom
adarshsanjeev:null-replicant-fix
Jun 20, 2023
Merged

Handle nulls in DruidCoordinator.getReplicationFactor#14447
kfaraz merged 2 commits intoapache:masterfrom
adarshsanjeev:null-replicant-fix

Conversation

@adarshsanjeev
Copy link
Contributor

This resolves an issue in master, which was caused due to the collision of some PRs. A null pointer exception occurs if the replicant information was not available in SegmentReplicationStatus in the Coordinator.


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.

Copy link
Contributor

@kfaraz kfaraz 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 catching this, @adarshsanjeev !
Are there tests that verify this?

@kfaraz kfaraz added the Bug label Jun 20, 2023
@adarshsanjeev
Copy link
Contributor Author

@kfaraz I think org.apache.druid.testsEx.leadership.ITHighAvailabilityTest fails due to this

@kfaraz
Copy link
Contributor

kfaraz commented Jun 20, 2023

Could you add a couple of lines in the existing DruidCoordinatorTest so that coverage is handled?

@kfaraz kfaraz merged commit f5cc823 into apache:master Jun 20, 2023
@abhishekagarwal87 abhishekagarwal87 added this to the 27.0 milestone Jul 19, 2023
@abhishekagarwal87 abhishekagarwal87 changed the title Fix exception if replicant information is not available Handle nulls in DruidCoordinator.getReplicationFactor Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants