Skip to content

Commit

Permalink
feat: Enable leader aware routing by default (#2567)
Browse files Browse the repository at this point in the history
BEGIN_COMMIT_OVERRIDE
feat: Enable leader aware routing by default. This update contains performance optimisations that will reduce the latency of read/write transactions that originate from a region other than the default leader region.
END_COMMIT_OVERRIDE
  • Loading branch information
rajatbhatta committed Aug 4, 2023
1 parent fa745e8 commit 441c1b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Expand Up @@ -700,7 +700,7 @@ public static class Builder
private CloseableExecutorProvider asyncExecutorProvider;
private String compressorName;
private String emulatorHost = System.getenv("SPANNER_EMULATOR_HOST");
private boolean leaderAwareRoutingEnabled = false;
private boolean leaderAwareRoutingEnabled = true;

private Builder() {
// Manually set retry and polling settings that work.
Expand Down
Expand Up @@ -680,8 +680,7 @@ public void testCompressorName() {

@Test
public void testLeaderAwareRoutingEnablement() {
assertFalse(
SpannerOptions.newBuilder().setProjectId("p").build().isLeaderAwareRoutingEnabled());
assertTrue(SpannerOptions.newBuilder().setProjectId("p").build().isLeaderAwareRoutingEnabled());
assertTrue(
SpannerOptions.newBuilder()
.setProjectId("p")
Expand Down

0 comments on commit 441c1b0

Please sign in to comment.