-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distributed query plan cache keys include the Router version number (#…
- Loading branch information
1 parent
9ef8296
commit a201cf5
Showing
5 changed files
with
34 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Distributed query plan cache keys include the Router version number ([PR #6406](https://github.com/apollographql/router/pull/6406)) | ||
|
||
More often than not, an Apollo Router release may contain changes that affect what query plans are generated or how they’re represented. To avoid using outdated entries from distributed cache, the cache key includes a counter that was manually incremented with relevant data structure or algorithm changes. Instead the cache key now includes the Router version number, so that different versions will always use separate cache entries. | ||
|
||
If you have enabled [Distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), starting with this release and going forward you should anticipate additional cache regeneration cost when updating between any Router versions. | ||
|
||
By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/6406 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,5 @@ | ||
use std::fs; | ||
use std::path::PathBuf; | ||
|
||
mod studio; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let cargo_manifest: serde_json::Value = basic_toml::from_str( | ||
&fs::read_to_string(PathBuf::from(&env!("CARGO_MANIFEST_DIR")).join("Cargo.toml")) | ||
.expect("could not read Cargo.toml"), | ||
) | ||
.expect("could not parse Cargo.toml"); | ||
|
||
let router_bridge = cargo_manifest | ||
.get("dependencies") | ||
.expect("Cargo.toml does not contain dependencies") | ||
.as_object() | ||
.expect("Cargo.toml dependencies key is not an object") | ||
.get("router-bridge") | ||
.expect("Cargo.toml dependencies does not have an entry for router-bridge"); | ||
let router_bridge_version = router_bridge | ||
.as_str() | ||
.or_else(|| { | ||
router_bridge | ||
.as_object() | ||
.and_then(|o| o.get("version")) | ||
.and_then(|version| version.as_str()) | ||
}) | ||
.expect("router-bridge does not have a version"); | ||
|
||
let mut it = router_bridge_version.split('+'); | ||
let _ = it.next(); | ||
let fed_version = it.next().expect("invalid router-bridge version format"); | ||
|
||
println!("cargo:rustc-env=FEDERATION_VERSION={fed_version}"); | ||
|
||
studio::main() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters