[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [FIX] Elasticsearch bulk operation flush - observe content length besides item...
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68fa12cfe7038_2ce1af0703bb@gitlab-sidekiq-low-urgency-cpu-bound-v2-69c854cfd9-lv9sm.mail> |
Victor Emanouilov pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki
Commits:
c370b228 by Victor Emanouilov at 2025-10-23T14:34:32+03:00
[FIX] Elasticsearch bulk operation flush - observe content length besides item count, so we avoid bypassing server limits and dropping full bulk chunks
- - - - -
1 changed file:
- lib/core/Search/Elastic/BulkOperation.php
Changes:
=====================================
lib/core/Search/Elastic/BulkOperation.php
=====================================
@@ -11,6 +11,7 @@ class Search_Elastic_BulkOperation
private $callback;
private $mapping_type;
private $buffer = '';
+ private $max_buffer_size = 20 * 1024 * 1024; // 20MB, ES defaults http.max_content_length to 100MB but it is safer to flush more frequently
public function __construct($limit, $callback, $mapping_type)
{
@@ -80,7 +81,7 @@ class Search_Elastic_BulkOperation
}
}
- if ($this->count >= $this->limit) {
+ if ($this->count >= $this->limit || strlen($this->buffer) >= $this->max_buffer_size) {
$this->flush();
}
}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c370b22853345fff9020cafd1198ee9b6053484f
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c370b22853345fff9020cafd1198ee9b6053484f
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs