-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributed query plan cache keys include the Router version number #6406
Changes from all commits
21deaeb
0f7e2f0
5e8acef
dff1c54
8a41d59
f79225d
18ad8a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this doesn’t need to mention There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put this paragraph first. The point is that almost every release has had a cache key change, which comes with the additional cache regeneration cost. If people read the first paragraph, they'll think this is more than what's currently happening, but it effectively isn't. |
||
|
||
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 |
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() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put this (though filename prefix) in the "Configuration" section of the changelog, but none of the options in
xtask changeset create
seemed like a great fit.CHANGELOG.md
has some> [!IMPORTANT]
sections, is that done manually when editing for a release?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do that manually in the release PR, since it has to go in the top of the changelog