Skip to content

Tolerate endpoints without a location when detecting the local DC - #693

Open
Myllyenko wants to merge 1 commit into
ydb-platform:masterfrom
Myllyenko:fix/priority-picker-null-location
Open

Tolerate endpoints without a location when detecting the local DC#693
Myllyenko wants to merge 1 commit into
ydb-platform:masterfrom
Myllyenko:fix/priority-picker-null-location

Conversation

@Myllyenko

Copy link
Copy Markdown

detectLocalDC grouped endpoints with Collectors.groupingBy on EndpointRecord::getLocation, which throws NullPointerException for a null key. The endpoint that a transport bootstraps with has no location: it is built by getDiscoveryEndpoint from the connection string. So YdbTransportImpl.start seeded the pool with that endpoint and blew up before reaching the "fewer than two datacenters" guard, making BalancingSettings.detectLocalDs unusable in fallback mode.

detectLocalDC grouped endpoints with Collectors.groupingBy on
EndpointRecord::getLocation, which throws NullPointerException for a null
key. The endpoint that a transport bootstraps with has no location: it is
built by getDiscoveryEndpoint from the connection string. So
YdbTransportImpl.start seeded the pool with that endpoint and blew up before
reaching the "fewer than two datacenters" guard, making
BalancingSettings.detectLocalDs unusable in fallback mode.

Filter out endpoints with no location - they say nothing about
datacenters - and treat a null endpoint list as "no local DC".
@Myllyenko
Myllyenko force-pushed the fix/priority-picker-null-location branch from d9ee791 to 3a8a21e Compare August 6, 2026 08:49
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.87%. Comparing base (d876581) to head (3a8a21e).

Files with missing lines Patch % Lines
...n/java/tech/ydb/core/impl/pool/PriorityPicker.java 0.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #693      +/-   ##
============================================
- Coverage     71.91%   71.87%   -0.04%     
- Complexity     3474     3475       +1     
============================================
  Files           390      390              
  Lines         16220    16221       +1     
  Branches       1698     1698              
============================================
- Hits          11664    11659       -5     
- Misses         3904     3910       +6     
  Partials        652      652              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant