Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-60274: Set an upper bound for K value for KNN queries (#1953)
# JIRA https://issues.couchbase.com/browse/MB-60274 # Description Currently, the value of K in KNN queries is only lower-bounded to 1 without an upper limit. This lack of an upper boundary leads to issues where users setting K to extremely high values, such as 999999999, cause a crash due to excessive memory allocation exceeding 8GB. To address this issue, this commit introduces an upper bound check for variable K. Setting an upper limit of 10000 for K prevents excessive memory demands, capping the maximum memory requirement at a reasonable 120KB. This change ensures system stability by preventing memory overflow issues caused by excessively high K values."
- Loading branch information