Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause:
Journald rotating log files
Consequence:
Rsyslog duplicating messages
Fix:
use module(load="imjournal" StateFile="imjournal.state" WorkAroundJournalBug="on") instead of default.
Result:
Messages are not duplicated anymore. Be aware that there is risk of performance impact while using this option.
Description of problem:
When the journal rotates only new logs from the
previous location spot in the journal should be
collected when the journal is re-opened. Instead,
it appears that certain logs are re-read and
appear as duplicates in the rsyslog output.
Version-Release number of selected component (if applicable):
rsyslogd 8.24.0, compiled with:
PLATFORM: x86_64-redhat-linux-gnu
PLATFORM (lsb_release -d):
FEATURE_REGEXP: Yes
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
memory allocator: system default
Runtime Instrumentation (slow code): No
uuid support: Yes
Number of Bits in RainerScript integers: 64
How reproducible:
Fairly easily with the right logging rate for a
journald configuration to cause the journal files
to rotate.
Steps to Reproduce:
1. Create unique log messages flowing through
journal periodically
2. Place a load on journald that will cause sufficient
logs to be collected to cause rotation
3. Observe the output of logs where ever rsyslog is
directed to send them (files, or otherwise, or both)
Actual results:
Duplicates appear in all output methods configured.
Expected results:
No duplicates are seen in any output method.
I have what appears to be solution to this bug that I am testing in a standalone program and will post shortly once I clean it up.
This fix is basically fetching the cursor before the sd_journal_get_fd/sd_journal_process calls, from what I can tell.
I am going to open a systemd issue regarding this to be sure this is the proper method to tail the journal continually.
The fix is to NOT reload the journal, but be sure to create the inotify file descriptor via the sd_journal_get_fd() API immediately after sd_journal_open() is called. See the attached systemd issue, 7998 for more details.
A patch upstream has been proposed for rsyslog at: https://github.com/rsyslog/rsyslog/pull/2437
Has the updated patch with the regression removed been proposed upstream yet?
I still have some reservations about this patch, in particular that it is arguably covering up a problem the should be solved by the systemd APIs themselves, and it proposes add a call to fetch the cursor after every log entry is fetched (which might be a performance impact (I'll be measuring that shortly)).
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHEA-2018:3135
Description of problem: When the journal rotates only new logs from the previous location spot in the journal should be collected when the journal is re-opened. Instead, it appears that certain logs are re-read and appear as duplicates in the rsyslog output. Version-Release number of selected component (if applicable): rsyslogd 8.24.0, compiled with: PLATFORM: x86_64-redhat-linux-gnu PLATFORM (lsb_release -d): FEATURE_REGEXP: Yes GSSAPI Kerberos 5 support: Yes FEATURE_DEBUG (debug build, slow code): No 32bit Atomic operations supported: Yes 64bit Atomic operations supported: Yes memory allocator: system default Runtime Instrumentation (slow code): No uuid support: Yes Number of Bits in RainerScript integers: 64 How reproducible: Fairly easily with the right logging rate for a journald configuration to cause the journal files to rotate. Steps to Reproduce: 1. Create unique log messages flowing through journal periodically 2. Place a load on journald that will cause sufficient logs to be collected to cause rotation 3. Observe the output of logs where ever rsyslog is directed to send them (files, or otherwise, or both) Actual results: Duplicates appear in all output methods configured. Expected results: No duplicates are seen in any output method.