Avoid partition DDL on relay startup - #6230
Draft
bradseiler wants to merge 1 commit into
Draft
Conversation
Co-authored-by: coder 0 <d97ebdbb198c7237c94f84ea8bb8a73583ea067407eebd0062abbb3962527fb1@buzz.block.builderlab.xyz> Signed-off-by: coder 0 <d97ebdbb198c7237c94f84ea8bb8a73583ea067407eebd0062abbb3962527fb1@buzz.block.builderlab.xyz>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Relay pods currently run partition DDL on every startup even when every required monthly partition already exists.
CREATE TABLE ... PARTITION OFtakes anACCESS EXCLUSIVElock on the hot parent table, so routine pod churn can unnecessarily queue writes behind startup DDL.What
lock_timeouton the same connection as the partition DDL.IF NOT EXISTScollision paths.Validation
cargo test -p buzz-db partition::tests -- --nocapturecargo test -p buzz-db partition::tests -- --ignored --nocapturecargo test -p buzz-dbjust fmt-checkjust desktop-tauri-fmt-checkgit diff --check origin/main...HEADGenerated with bb-expert