Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ER_MAX_PREPARED_STMT_COUNT_REACHED in batch inserts #207

Closed
webigorkiev opened this issue Aug 31, 2022 · 3 comments
Closed

ER_MAX_PREPARED_STMT_COUNT_REACHED in batch inserts #207

webigorkiev opened this issue Aug 31, 2022 · 3 comments

Comments

@webigorkiev
Copy link

Hello

mariadb@3.0.1

When i use batch inserts or pool.batch
growing
Com_stmt_prepare
but
Com_stmt_close = 0

And then i get ER_MAX_PREPARED_STMT_COUNT_REACHED error

mariadb@2.5.6

This does not appear

Thanks

@webigorkiev
Copy link
Author

Workaround

prepareCacheLength: 0

@rusher
Copy link
Collaborator

rusher commented Oct 5, 2022

found the issue. Problem reside in prepare cache that doesn't execute close immediatly, resulting in having more cached prepare than prepareCacheLength

@rusher
Copy link
Collaborator

rusher commented Oct 6, 2022

Current implementation use @alloc/quick-lru that evict previous cache by bulk. Cache maximum option prepareCacheLength is then not repected, because can be up to 2x that value, leading to error when reaching server max_prepared_stmt_count. After implementation verification and benchmarking, lru-cache will be the replacement, resolving the issue in next version

@rusher rusher closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants