Repository navigation
Fixed
- A checkpointer or store could fail with
prepared statement "_pg3_N" does not exist(SQLSTATE 26000) after a batch failed before its statements ran, even when the error that failed the batch was retryable. psycopg prepares a statement on its sixth run on a connection (prepare_threshold=5, the default), and in pipeline mode it records the statement as prepared before the server confirms it. When an earlier statement in the batch failed, such as BEGIN refused by CockroachDB's license limit, the server never prepared it, but psycopg kept using it. A checkpoint write then failed on its retry. A store read failed on that connection every time until the connection closed, so a pool could hand out the broken connection until it was replaced, by default within an hour. Statements sent in a pipeline are no longer prepared. Statements outside a pipeline, such as the checkpointers' reads on a pool or on a connection withoutpipeline=True, still are, and every connection keeps its ownprepare_threshold. examples/long_term_memory.pyand the store guide no longer print pydantic serializer warnings. Their tools now annotate the runtime asToolRuntime[Context, dict]. A plainToolRuntimeexpects no context, andToolRuntime[Context]fails on Python 3.10, which cannot fill in the default of the second type argument.- The checkpointer guide said PostgresSaver's
prepare_threshold=0turns prepared statements off. It prepares every query from its first run.
What's Changed
- chore(deps-dev): bump ruff from 0.17.1 to 0.17.2 by @dependabot[bot] in #18
- fix: send statements in a pipeline unprepared for 0.5.1 by @viragtripathi in #20
Full Changelog: v0.5.0...v0.5.1