Skip to content
Snippets Groups Projects

feat: unprepare statement references after sql execution

Merged Denis Smirnov requested to merge sd/execute into 2.11.2-picodata
All threads resolved!

Summary

Picodata SQL now manages the Tarantool statement cache using a dedicated SQL fiber that handles preparation and unpreparation of statements based on an LRU eviction policy. Prepared statements can be executed across different sessions by SQL clients.

Previously, when a client executed a prepared statement, it increased the reference count in the statement cache and linked the statement to the client's session. While this approach seemed fine, it caused issues during eviction, as references to these statements remained in client sessions, preventing proper eviction.

This commit addresses the issue by ensuring that if a statement is added to the current session during execution, it is removed and the session state is restored once execution is complete.

Discussion:

https://docs.google.com/document/d/181CwxhDwrUkyMbZu7MOUG0BJw2M1rJeuiQP2-M2TpFk/edit#heading=h.mekvqbvwrhq8

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Denis Smirnov added 2 commits

    added 2 commits

    • 9a8559d8 - 1 commit from branch 2.11.2-picodata
    • d647be0e - feat: unprepare statement references after sql execution

    Compare with previous version

  • Denis Smirnov added 1 commit

    added 1 commit

    • dd7dd0ea - feat: unprepare statement references after sql execution

    Compare with previous version

  • Denis Smirnov added 1 commit

    added 1 commit

    • d5fc9c67 - feat: unprepare statement references after sql execution

    Compare with previous version

  • Denis Smirnov added 1 commit

    added 1 commit

    • 192bfc43 - feat: unprepare statement references after sql execution

    Compare with previous version

  • Arseniy Volynets
  • Arseniy Volynets resolved all threads

    resolved all threads

  • Denis Smirnov added 1 commit

    added 1 commit

    • 8b570cd4 - fix: check sql statement is not busy on unprepare

    Compare with previous version

  • Denis Smirnov added 1 commit

    added 1 commit

    • d60ac497 - fix: check sql statement is not busy on unprepare

    Compare with previous version

  • Dmitry Ivanov
    • Resolved by Denis Smirnov

      The patch mostly makes sense, but as an occasional reviewer of this story, I can't help but think that I have no idea whether the tests check every relevant code path or not. The tests I see in this patch make sense, but is that enough? Could you collect a code coverage report? Would that be a tall request?

  • Denis Smirnov added 1 commit

    added 1 commit

    • dd0b70b0 - fix: check sql statement is not busy on unprepare

    Compare with previous version

  • Dmitry Ivanov approved this merge request

    approved this merge request

  • Denis Smirnov resolved all threads

    resolved all threads

  • Denis Smirnov resolved all threads

    resolved all threads

  • Please register or sign in to reply
    Loading