feat: unprepare statement references after sql execution
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:
Merge request reports
Activity
assigned to @darthunix
requested review from @funbringer
@senya_volynets посмотри, пожалуйста
- Resolved by Arseniy Volynets
- Resolved by Arseniy Volynets
a test is needed that ref count is correct:
- prepare stmt
- execute_prepared_ext
- unprepare stmt
- check stmt was deleted
Edited by Arseniy Volynets
added 1 commit
- dd7dd0ea - feat: unprepare statement references after sql execution
added 1 commit
- d5fc9c67 - feat: unprepare statement references after sql execution
added 1 commit
- 192bfc43 - feat: unprepare statement references after sql execution
- Resolved by Arseniy Volynets
added 1 commit
- 8b570cd4 - fix: check sql statement is not busy on unprepare
added 1 commit
- d60ac497 - fix: check sql statement is not busy on unprepare
- Resolved by Denis Smirnov
- 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?
added 1 commit
- dd0b70b0 - fix: check sql statement is not busy on unprepare