From c5dce5046c8d445c34f48116f16ed6b33f2a66ff Mon Sep 17 00:00:00 2001 From: cuiweiwei Date: Mon, 2 Sep 2024 17:05:21 +0800 Subject: [PATCH] fix es query size issue --- 0007-fix-es-query-size-issue.patch | 28 ++++++++++++++++++++++++++++ aops-apollo.spec | 6 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0007-fix-es-query-size-issue.patch diff --git a/0007-fix-es-query-size-issue.patch b/0007-fix-es-query-size-issue.patch new file mode 100644 index 0000000..63d73cb --- /dev/null +++ b/0007-fix-es-query-size-issue.patch @@ -0,0 +1,28 @@ +From f7879d9eeb03e989885f2103d9b71d28e10fc31e Mon Sep 17 00:00:00 2001 +From: cuiweiwei +Date: Mon, 2 Sep 2024 16:32:37 +0800 +Subject: [PATCH] =?UTF-8?q?es=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0size?= + =?UTF-8?q?=E5=8F=82=E6=95=B0?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + apollo/database/proxy/cve.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/apollo/database/proxy/cve.py b/apollo/database/proxy/cve.py +index eac1af0..3fbf3df 100644 +--- a/apollo/database/proxy/cve.py ++++ b/apollo/database/proxy/cve.py +@@ -1174,6 +1174,7 @@ class CveProxy(CveMysqlProxy, CveEsProxy): + """ + query_body = self._general_body() + query_body['query']['bool']['must'].append({"terms": {"_id": cve_list}}) ++ query_body['size'] = len(cve_list) + operation_code, res = self.query(CVE_INDEX, query_body, source=True) + + if not operation_code: +-- +2.39.5 (Apple Git-154) + diff --git a/aops-apollo.spec b/aops-apollo.spec index 6273363..4a87f93 100644 --- a/aops-apollo.spec +++ b/aops-apollo.spec @@ -1,6 +1,6 @@ Name: aops-apollo Version: v1.4.1 -Release: 4 +Release: 5 Summary: Cve management service, monitor machine vulnerabilities and provide fix functions. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -11,6 +11,7 @@ Patch0003: 0003-update-verification-method-for-host-ip-fieldl.patch Patch0004: 0004-fix-TimedCorrectTask.patch Patch0005: 0005-add-reboot-field-to-query-host-info-api.patch Patch0006: 0006-fix-bug-with-host-count-in-cve-fix-task.patch +Patch0007: 0007-fix-es-query-size-issue.patch BuildRequires: python3-setuptools Requires: aops-vulcanus >= v1.3.0 @@ -73,6 +74,9 @@ popd %{python3_sitelib}/aops_apollo_tool/* %changelog +* Mon Sep 02 2024 cuiweiwei - v1.4.1-5 +- fix es query size issue + * Wed Jul 24 2024 wenxin - v1.4.1-4 - fix bug with host count in cve fix task -- Gitee