You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The proxy's PS "cache" is implemented as a map that holds known preparedIDs and a boolean indicating whether a prepared statement is a read or a write. When prepared statements are used appropriately by client applications, this should not pose any issue in terms of map size or churn.
However, it is not uncommon for client applications to misuse prepared statements. While re-preparing the same statement over and over would be harmless, a client application that does something like hardcoding parameters in the statement for every call and then prepare it would cause a different preparedId every time. This would make the map grow very large, resulting in performance degradation and high memory usage and, in the worst cases, making the the proxy crash.
To prevent this, we need to:
Add a test to reproduce the issue
Add a limit to the size of the map (this can be quite high, as the footprint of each element is very small, but at least it is not unbounded)
Change the PS cache maps to use an LRU cache, such as the one provided by the Hashicorp LRU library.
┆Issue is synchronized with this Jira Task by Unito
┆Components: Proxy
┆Issue Number: ZDM-522
The text was updated successfully, but these errors were encountered:
The proxy's PS "cache" is implemented as a map that holds known preparedIDs and a boolean indicating whether a prepared statement is a read or a write. When prepared statements are used appropriately by client applications, this should not pose any issue in terms of map size or churn.
However, it is not uncommon for client applications to misuse prepared statements. While re-preparing the same statement over and over would be harmless, a client application that does something like hardcoding parameters in the statement for every call and then prepare it would cause a different preparedId every time. This would make the map grow very large, resulting in performance degradation and high memory usage and, in the worst cases, making the the proxy crash.
To prevent this, we need to:
┆Issue is synchronized with this Jira Task by Unito
┆Components: Proxy
┆Issue Number: ZDM-522
The text was updated successfully, but these errors were encountered: