Skip to content

Commit 050309c

Browse files
committed
Reapply "feat: use Redis read replicas (#8405)"
This reverts commit 171c245.
1 parent 7d315f3 commit 050309c

File tree

18 files changed

+1106
-388
lines changed

18 files changed

+1106
-388
lines changed

.cargo/nextest.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[test-groups]
2+
redis = { max-threads = 6 }
3+
4+
[[profile.default.overrides]]
5+
# number of tests running with 'redis' in the name should be up to 6 at any given time to prevent
6+
# overloading the redis instances
7+
test-group = "redis"
8+
filter = "test(redis)"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Support Redis read replicas ([PR #8405](https://github.com/apollographql/router/pull/8405))
2+
3+
Read-only queries will now be sent to replica nodes when using clustered Redis. Previously, all commands would be sent
4+
to the master nodes.
5+
6+
This change applies to all Redis caches, including the query plan cache and the response cache.
7+
8+
By [@carodewig](https://github.com/carodewig) in https://github.com/apollographql/router/pull/8405

.circleci/config.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ commands:
253253
command: |
254254
curl https://mise.jdx.dev/install.sh | sh
255255
mise activate bash >> "$BASH_ENV"
256-
# --raw disables the terminal timer/progress bars, so if mise gets stuck,
257-
# it will not continue to produce output preventing CCI from timing it out
258-
mise install --yes --raw
256+
mise install --yes --quiet
259257
- when:
260258
condition:
261259
or:
@@ -271,9 +269,7 @@ commands:
271269
name: Install mise
272270
command: |
273271
scoop install mise@${MISE_VERSION#v}
274-
# --raw disables the terminal timer/progress bars, so if mise gets stuck,
275-
# it will not continue to produce output preventing CCI from timing it out
276-
mise install --yes --raw
272+
mise install --yes --quiet
277273
fetch_dependencies:
278274
steps:
279275
- run:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ dhat-heap.json
4242
# generated fuzz/ files
4343
fuzz/crash-*
4444
fuzz/slow-unit-*
45-
fuzz/timeout-*
45+
fuzz/timeout-*
46+
47+
.config/mise/mise.local.toml

DEVELOPMENT.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The **Apollo Router Core** is a configurable, high-performance **graph router**
99

1010
## Development
1111

12-
We use [`mise`](https://mise.jdx.dev/) to manage toolchain dependencies.
12+
We use [`mise`](https://mise.jdx.dev/) to manage toolchain and test dependencies.
1313
Example commands in this document assume that mise shims are available in the environment.
1414
If you do not use `mise activate`, you can use `mise x -- <COMMAND>` in place of the commands below, for example `mise x -- cargo build`.
1515

@@ -28,15 +28,16 @@ docker compose up -d
2828
```
2929

3030
This starts:
31-
- **Redis** (port 6379-7005) - Required for entity caching, response caching, and Redis-related integration tests
32-
- **PostgreSQL** (port 5432) - Used by database integration tests
31+
- **Redis** (port 6379, 7000-7005) - Required for entity caching, response caching, and Redis-related integration tests
3332
- **Zipkin** (port 9411) - For distributed tracing tests
3433
- **Datadog Agent** (port 8126) - For Datadog telemetry integration tests
3534

3635
Some tests that use the features above are configured with `required_to_start: true`. The router won't start if these services aren't available, causing test failures.
3736

3837
**Note:** `-d` runs services in the background. Remove `-d` if you want to see logs or run in foreground.
3938

39+
Several tests also require the `redis-cli` binary; this is installed by default if you use `mise`.
40+
4041
#### Enterprise feature testing
4142

4243
Some tests require Apollo GraphOS credentials to test enterprise features like licensing, reporting, and Apollo Studio integration.
@@ -53,7 +54,8 @@ export TEST_APOLLO_GRAPH_REF="your-graph-ref@variant"
5354

5455
### Testing
5556

56-
Tests on this repository are run using [nextest](https://nexte.st/). nextest is installed automatically when you use `mise`.
57+
Tests on this repository are run using [nextest](https://nexte.st/). nextest is installed automatically when you use
58+
`mise`.
5759

5860
#### Test environment setup
5961

apollo-router/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fred = { version = "10.1.0", features = [
9898
"i-cluster",
9999
"tcp-user-timeouts",
100100
"metrics",
101+
"replicas",
101102
"serde-json"
102103
] }
103104
futures = { version = "0.3.30", features = ["thread-pool"] }
@@ -310,6 +311,7 @@ fred = { version = "10.1.0", features = [
310311
"mocks",
311312
"i-cluster",
312313
"tcp-user-timeouts",
314+
"replicas"
313315
] }
314316
futures-test = "0.3.30"
315317
insta.workspace = true

0 commit comments

Comments
 (0)