[POC][DISCUSS] preserve batched events order#11099
[POC][DISCUSS] preserve batched events order#11099colinsurprenant wants to merge 1 commit intoelastic:masterfrom
Conversation
|
From a discussion with @danhermann he pointed out that this solution does not solve this aggregate filter scenario raised by @yaauie in https://gist.github.com/yaauie/82e199687c490a2e04fe1f0c9d9a7fee What I understand in the above scenario, the order of each batch split created by the conditionals is not really important but this is more about the order in which each filter is called which should respect the configuration syntactic order and that order is probably not preserved by the java execution engine. This is a completely different problem. |
|
The idea is nice. In case an event is splitted in more events, we could use a hierarchical ordering instead of natural (like the version number in software, so version of part of event 1 are versioned as 1.1 and 1.2 and so on. In this case I don't know if all the code changes could be isolated into the Java Execution's code. The case of aggregation could be thought as "keep the minimum order id of all the events that concur to create the aggregated event". I suspect in this case that the code change interest the plugin, and this dirty the design because code related to the execution goes in the plugin. |
|
closing in favour of #11524 |
NOT FOR REVIEW, FOR DISCUSSION.
This is a quick and incomplete POC to demonstrate the idea of events ordering within batches as a possible solution for #10938 and #11062
I will not go over the problem description, see the above issues, but the idea of this solution here is:
orderfield in the event with that sequence number, obviously this is just a POC and a proper sequence attribute should be implemented.multiReceivemethod sorts the events based on that sequence numberorderfield before passing them to the output plugin.This implementation is incomplete and has a few caveats; only the memory queue assigns the sequence number, it does not take into account new events that are added by the filters.
I don't think solving the case of the new events would be too difficult.
With the following example:
It preserves order correctly with this patch:
It does not preserve order without the patch:
WDYT?