add rcptid to message related trace messages#3972
add rcptid to message related trace messages#3972gaborznagy merged 13 commits intosyslog-ng:masterfrom
Conversation
|
Build SUCCESS |
90f96a6 to
354ee30
Compare
|
Build SUCCESS |
|
I'm not entirely convinced that adding Of course, when a copy-on-write takes place that address is changed, so this is the scenario where And wouldn't be more convenient if trace level would turn on What do you think @rfaircloth-splunk, @bazsi? |
|
@bazsi you've updated the internal ivykis in this PR too. I guess that's accidental. |
|
Just a note about what we discussed:
|
|
Just out of curiosity did some testing: The configuration: Running: Based on this, it does not look like promising. |
354ee30 to
3835efc
Compare
|
Build SUCCESS |
|
@kira-syslogng do stresstest this please test branch=micek_perf_with_rcptid |
|
@kira-syslogng do stresstest branch=micek_perf_with_rcptid |
|
Build SUCCESS |
|
Kira-stress-test: Build SUCCESS |
|
I have also run an internal perf test for enabled rcptid and it shows a ~30% decrease in our fastest combination.
options {
keep_hostname(yes);
keep_timestamp(no);
use_rcptid(yes);
stats_level(2);
use_dns(no);
};
source s_network_d7e6b375b62e415f8924fd4d883e0e80 {
network(
ip(0.0.0.0)
log_fetch_limit(1000)
log_iw_size(10000)
max_connections(10)
port(61001)
);
};
destination d_file_91b6a8918dc742e98e8f447485517f5f {
file(
"/tmp/output.$HOST"
flush_lines(1000)
log_fifo_size(20000)
);
};
log {
source(s_network_d7e6b375b62e415f8924fd4d883e0e80);
destination(d_file_91b6a8918dc742e98e8f447485517f5f);
flags(flow-control);
};
|
|
I think using the |
|
The original idea of rcptid was to be able to reorder the messages to its
reception order, so the reason it is monotonous was this.
I am not sure anyone uses it for this purpose though. Such a number is
useful in cases where you have multiple parallel paths to storage.
Before changing semantics, I'd probably revisit the locking strategy within
rcptid, because I am sure it could be improved.
But I'd merge this as is, maybe with the addition of -t command line option
enabling rcptid as well.
…On Tue, Apr 12, 2022, 10:59 Kókai Péter ***@***.***> wrote:
I think using the rcptid is a good idea, but the current implementation
is hungry.
According to the documentation it should be a monotone number, but I do
not think that is really *required*. If we can let that requirement go,
and focus on uniqueness. Maybe we can come up with a different
implementation that does not require locking.
One such idea would be to have a per thread counter, which is prefixed
with thread id.
—
Reply to this email directly, view it on GitHub
<#3972 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFOK5WL7HXRBZPZP6HSEZTVEU3QVANCNFSM5SM6V7JQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
This PR is exciting. One comment early on in the PR was trace is really only useful for a single message. I think that is a very legacy way of thinking. Using trace on console this is true if I was to get a json blog with a the rcpti field into Splunk, Humio or other observability tools I could much more easily troubleshoot a running problem |
3835efc to
03e7a28
Compare
|
I have now added a commit to enable rcptid generation when --trace is passed as a command line option. Also, I went back and added rcptid to the very first debug message we emit about a new incoming log message. We can't enable rcptid now due to performance reasons, I'll revisit that in the future. But with all of this, this can be merged in my opinion. |
|
Build FAILURE |
|
@kira-syslogng retest this please; |
|
Build FAILURE |
|
@kira-syslogng retest this please; |
|
Build SUCCESS |
gaborznagy
left a comment
There was a problem hiding this comment.
@bazsi, the local ivykis is still updated in this PR.
Sorry for putting request for change flag on it, but I would like to avoid others accidentally merge this.
Otherwise looks good to me.
03e7a28 to
b634ae0
Compare
|
Sorry. git seems to add submodules to patches automatically during rebase, if I have it updated locally. I now removed it explicitly. |
|
Build SUCCESS |
b634ae0 to
f4229dc
Compare
|
I have done one last rebase in which I've renamed the macro generating the tags to match conventions, as these functions The trigger was that I was adding another set of these tags and it felt somewhat alien, I did some grepping: lib/gprocess.c:evt_tag_cap_t(const char *tag, cap_t cap) We have some inconsistent names still: bazsi@bzorp:~/src/syslog-ng/syslog-ng$ git grep ^EVTTAG *.h Nevertheless, I like the one with evt_tag prefix better, so I quickly renamed the change in this patchset. There are no other changes since @gaborznagy approved it, so please reapprove. |
|
Build SUCCESS |
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
In preparation of moving log_msg_new() to an MsgFormat method, rename msg_format_parse() and its related function to better express their function, namely that they parse into an existing LogMessage instance. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…t_parse() log_msg_new() was actually a feature envy and should have been a method for MsgFormat: it takes an MsgFormat instance and input data, and based on this it created and populates a LogMessage instance. Move this functionality from LogMessage to MsgFormat, straightening the dependencies in the right direction. Albeit the change is trivial, it cascades into a lot of files, primarily into test code. Test code should avoid doing syslog parsing anyway but in a lot of cases those still use it. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
f4229dc to
512288f
Compare
|
@gaborznagy I am afraid the new additions to this branch as described in #3972 (comment) warrant a new review. This branch is now a lot more than the rcptid tags in trace messages. The changes should be trivial but are quite sizable. Let me know if you want to split this. |
|
Build SUCCESS |
MrAnno
left a comment
There was a problem hiding this comment.
Thank you for the refactor commits, they look really good.
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
512288f to
2bb2539
Compare
|
Build SUCCESS |
gaborznagy
left a comment
There was a problem hiding this comment.
Sorry for kept you waiting, I've checked the internal build as discussed.
Approve.
|
I think #2828 can be closed thanks to this feature. :) |
The new log_msg_evt_tags() macro adds the rcptid value to the trace messages
making it easier to identify which msg we are manipulating at the moment.
In order to have a non-zero value for rcptid, one needs to enable
use-rcptid() in the configuration.
Fixes portions of #3967