Elasticsearch version: 6.5.4
Server OS version: CentOS
Describe the issue:
We are getting OOM Error and after analyzing heap dump we believe that this is directly related with problem
that zjsonpatch library (version 0.4.4) has and which was described in Memory issue with 0.4.0+ · Issue #77 · flipkart-incubator/zjsonpatch · GitHub and fixed in version 0.4.5.
Is newer version of Search Guard plugin use different version of zjsonpatch (>=0.4.5) or code was adjusted in a way that this problem no longer exists?
Provide logs:
[2021-03-12T07:16:35,559][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [data-14] fatal error in thread [elasticsearch[data-14][write][T#16]], exiting
java.lang.OutOfMemoryError: Java heap space
at com.flipkart.zjsonpatch.InternalUtils.longestCommonSubsequence(InternalUtils.java:31) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.getLCS(JsonDiff.java:446) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.compareArray(JsonDiff.java:337) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.generateDiffs(JsonDiff.java:324) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.compareObjects(JsonDiff.java:425) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.generateDiffs(JsonDiff.java:327) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.compareObjects(JsonDiff.java:425) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.generateDiffs(JsonDiff.java:327) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.compareObjects(JsonDiff.java:425) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.generateDiffs(JsonDiff.java:327) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.asJson(JsonDiff.java:47) ~[?:?]
at com.flipkart.zjsonpatch.JsonDiff.asJson(JsonDiff.java:38) ~[?:?]
at com.floragunn.searchguard.auditlog.impl.AbstractAuditLog.logDocumentWritten(AbstractAuditLog.java:571) ~[?:?]
at com.floragunn.searchguard.auditlog.impl.AuditLogImpl.logDocumentWritten(AuditLogImpl.java:197) ~[?:?]
at com.floragunn.searchguard.compliance.ComplianceIndexingOperationListenerImpl.postIndex(ComplianceIndexingOperationListenerImpl.java:157) ~[?:?]
at org.elasticsearch.index.shard.IndexingOperationListener$CompositeListener.postIndex(IndexingOperationListener.java:107) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:777) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:741) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.index.shard.IndexShard.applyIndexOperationOnPrimary(IndexShard.java:705) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.lambda$executeIndexRequestOnPrimary$3(TransportShardBulkAction.java:461) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction$$Lambda$3734/0x0000000800ecec40.get(Unknown Source) ~[?:?]
at org.elasticsearch.action.bulk.TransportShardBulkAction.executeOnPrimaryWhileHandlingMappingUpdates(TransportShardBulkAction.java:483) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.executeIndexRequestOnPrimary(TransportShardBulkAction.java:459) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:216) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:159) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.performOnPrimary(TransportShardBulkAction.java:151) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:139) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:79) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryShardReference.perform(TransportReplicationAction.java:1022) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryShardReference.perform(TransportReplicationAction.java:1000) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.support.replication.ReplicationOperation.execute(ReplicationOperation.java:102) ~[elasticsearch-6.5.4.jar:6.5.4]
at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.onResponse(TransportReplicationAction.java:356) ~[elasticsearch-6.5.4.jar:6.5.4]
Please advise.
Thanks,
Daniel