Conversation
There was a problem hiding this comment.
Pull request overview
Updates the caching layer to prevent truncation of large cached payloads in MySQL by ensuring kv_cache.v can store large text, and attempts to make the schema adjustment run only once per process.
Changes:
- Added a module-level lock/flag and
ensure_kv_cache_schema(engine)to adjustkv_cache.vtoLONGTEXTon MySQL. - Invoked the schema ensure step before cache reads/writes in
get_cached()andsave_cache().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Motivation
kv_cache.vcolumn can hold large text in MySQL.Description
Lockand added module-level_kv_cache_schema_checkedand_kv_cache_schema_lockflags to coordinate a one-time check.ensure_kv_cache_schema(engine)which alters thekv_cachetable to set columnvtoLONGTEXTwhenengine.dialect.name == "mysql"and marks the schema check complete.ensure_kv_cache_schema(engine)at the start ofget_cachedandsave_cacheso the schema is validated/updated before cache reads/writes.Testing
vcolumn is converted toLONGTEXTand caching round-trips succeed, and the tests passed.Codex Task