Revert "xds: Disable LOGICAL_DNS in XdsDepMan until used"

This reverts commit d374b26b68 as part of
reverting 297ab05efe.
This commit is contained in:
Eric Anderson 2025-07-14 13:24:54 -07:00
parent 2ecbd437c3
commit f3daf93ce5
2 changed files with 4 additions and 21 deletions

View File

@ -82,9 +82,6 @@ final class XdsDependencyManager implements XdsConfig.XdsClusterSubscriptionRegi
private static final Locality LOGICAL_DNS_CLUSTER_LOCALITY = Locality.create("", "", "");
private static final int MAX_CLUSTER_RECURSION_DEPTH = 16; // Specified by gRFC A37
static boolean enableLogicalDns = false;
private final String listenerName;
private final XdsClient xdsClient;
private final SynchronizationContext syncContext;
@ -366,14 +363,9 @@ final class XdsDependencyManager implements XdsConfig.XdsClusterSubscriptionRegi
}
break;
case LOGICAL_DNS:
if (enableLogicalDns) {
TrackedWatcher<List<EquivalentAddressGroup>> dnsWatcher =
tracer.getWatcher(DNS_TYPE, cdsUpdate.dnsHostName());
child = new EndpointConfig(dnsToEdsUpdate(dnsWatcher.getData(), cdsUpdate.dnsHostName()));
} else {
child = new EndpointConfig(StatusOr.fromStatus(
Status.INTERNAL.withDescription("Logical DNS in dependency manager unsupported")));
}
TrackedWatcher<List<EquivalentAddressGroup>> dnsWatcher =
tracer.getWatcher(DNS_TYPE, cdsUpdate.dnsHostName());
child = new EndpointConfig(dnsToEdsUpdate(dnsWatcher.getData(), cdsUpdate.dnsHostName()));
break;
default:
child = new EndpointConfig(StatusOr.fromStatus(Status.UNAVAILABLE.withDescription(
@ -814,9 +806,7 @@ final class XdsDependencyManager implements XdsConfig.XdsClusterSubscriptionRegi
addEdsWatcher(getEdsServiceName());
break;
case LOGICAL_DNS:
if (enableLogicalDns) {
addDnsWatcher(update.dnsHostName());
}
addDnsWatcher(update.dnsHostName());
break;
case AGGREGATE:
update.prioritizedClusterNames()

View File

@ -152,7 +152,6 @@ public class XdsDependencyManagerTest {
private XdsDependencyManager xdsDependencyManager = new XdsDependencyManager(
xdsClient, syncContext, serverName, serverName, nameResolverArgs);
private boolean savedEnableLogicalDns;
@Before
public void setUp() throws Exception {
@ -169,8 +168,6 @@ public class XdsDependencyManagerTest {
testWatcher = new TestWatcher();
xdsConfigWatcher = mock(TestWatcher.class, delegatesTo(testWatcher));
defaultXdsConfig = XdsTestUtils.getDefaultXdsConfig(serverName);
savedEnableLogicalDns = XdsDependencyManager.enableLogicalDns;
}
@After
@ -183,8 +180,6 @@ public class XdsDependencyManagerTest {
assertThat(adsEnded.get()).isTrue();
assertThat(lrsEnded.get()).isTrue();
assertThat(fakeClock.getPendingTasks()).isEmpty();
XdsDependencyManager.enableLogicalDns = savedEnableLogicalDns;
}
@Test
@ -754,7 +749,6 @@ public class XdsDependencyManagerTest {
@Test
public void testLogicalDns_success() {
XdsDependencyManager.enableLogicalDns = true;
FakeSocketAddress fakeAddress = new FakeSocketAddress();
nameResolverRegistry.register(new FakeNameResolverProvider(
"dns:///dns.example.com:1111", fakeAddress));
@ -795,7 +789,6 @@ public class XdsDependencyManagerTest {
@Test
public void testLogicalDns_noDnsNr() {
XdsDependencyManager.enableLogicalDns = true;
Cluster cluster = Cluster.newBuilder()
.setName(CLUSTER_NAME)
.setType(Cluster.DiscoveryType.LOGICAL_DNS)