Revert "Change the default for staleAge to be maxAge - 1 minute rather than maxage (unless maxAge is < 2 minutes) for the RLS configuration from proto. (#10397)" (#10399)

This reverts commit 56d1c42c80.
This commit is contained in:
Larry Safran 2023-07-20 15:32:35 -07:00 committed by GitHub
parent 864d30caed
commit 9f78b2bd3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ final class RlsProtoConverters {
maxAge = MAX_AGE_NANOS; maxAge = MAX_AGE_NANOS;
} }
if (staleAge == null) { if (staleAge == null) {
staleAge = maxAge >= MINUTES.toNanos(2) ? maxAge - MINUTES.toNanos(1) : maxAge; staleAge = MAX_AGE_NANOS;
} }
maxAge = Math.min(maxAge, MAX_AGE_NANOS); maxAge = Math.min(maxAge, MAX_AGE_NANOS);
staleAge = Math.min(staleAge, maxAge); staleAge = Math.min(staleAge, maxAge);

View File

@ -354,7 +354,7 @@ public class RlsProtoConvertersTest {
.lookupService("service1") .lookupService("service1")
.lookupServiceTimeoutInNanos(TimeUnit.SECONDS.toNanos(10)) .lookupServiceTimeoutInNanos(TimeUnit.SECONDS.toNanos(10))
.maxAgeInNanos(TimeUnit.MINUTES.toNanos(5)) .maxAgeInNanos(TimeUnit.MINUTES.toNanos(5))
.staleAgeInNanos(TimeUnit.MINUTES.toNanos(4)) .staleAgeInNanos(TimeUnit.MINUTES.toNanos(5))
.cacheSizeBytes(5 * 1024 * 1024) .cacheSizeBytes(5 * 1024 * 1024)
.defaultTarget("us_east_1.cloudbigtable.googleapis.com") .defaultTarget("us_east_1.cloudbigtable.googleapis.com")
.build(); .build();