Skip to content

journald:There is always a repeated log between the .journal files #18005

Closed

Description

@syyhao1994

systemd version the issue has been seen with

…

Used distribution

fedora33

CPU architecture issue was seen on

aarch64 x86_64

Expected behaviour you didn't see

There is no repeat between .journal files.

Unexpected behaviour you saw

There is always repeat logs between .journal files.
As the picture showed, the log get by journalctl(left) and the log get by journalctl --file [email protected](right). The last log and the first log is always the same. And we could not skip it as this pr merged:#17926.
I don't find this because for quickly reproduce the problem i set the RuntimeMaxFileSize=0.5M, this problem does not exist as the .journal file is smaller than 1M.
log1

Steps to reproduce the problem

This problem only exist when the size of .journal file is lagger than 2M. As i set the RuntimeMaxFileSize=2M. The rest steps are the same at the issue #17540. And i upload tow .journal files that the problem exist, you can get it by:
https://github.com/syyhao1994/files/blob/master/system%40bd998cb49e4b4319a8474eadc9cbb624-0000000000039e2f-0005b6a3a8a621d9.journal
https://github.com/syyhao1994/files/blob/master/system%40bd998cb49e4b4319a8474eadc9cbb624-000000000003aa88-0005b6a3a8a6fddf.journal

1.the test.sh is used as below

[root@localhost ~]# cat test.sh
#!/bin/bash
while true
do
    for i in {0..10}
    do
        echo "MCE $i"
        echo "CPU 0 BANK 4"
        echo "MISC 0 ADDR 118abb000"
        echo "MCG status:"
        echo "MCi status:"
        echo "Corrected error"
        echo "Error enabled"
        echo "MCi_MISC register valid"
        echo "MCi_ADDR register valid"
        echo "MCA: MEMORY CONTROLLER RD_CHANNEL2_ERR"
        echo "Transaction: Memory read error"
        echo "PCU: PCU internal error No Error"
        echo "STATUS 9c00000000210092 MCGSTATUS 0"
        echo "MCGCAP 100010a APICID 0 SOCKETID 0"
        echo "MICROCODE 1"
        echo "CPUID Vendor Intel Family 6 Model 79 Step 1"
        echo "Hardware event. This is not a software error."
    done
done
[root@localhost ~]# cat /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
/usr/bin/bash /root/test.sh &

3
systemctl restart rc-local.service or reboot

kill -9 pid(test.sh) 

Killing the test.sh.

  1. We get the journactl_all.log by executing the command below, you will find the log in journactl_all.log is not continuous as we want. This log could be seen at the link: https://github.com/syyhao1994/files/blob/master/journactl_all.log.
journalctl > journalctl_all.log

Then i got the systemxxx_all.log by executing the command list below. And i compared these two log, i found that the missing log was exactly between the two [email protected] files. This log could be seen as the link: https://github.com/syyhao1994/files/blob/master/systemxxx_all.log

journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-00000000000277a9-0005b29e02ae604d.journal > /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-0000000000027c10-0005b29e02aeb88c.journal >> /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-000000000002807b-0005b29e02af0bf1.journal >> /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-00000000000284e6-0005b29e02af582b.journal >> /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-000000000002894d-0005b29e02afabcc.journal >> /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-0000000000028db8-0005b29e02affdba.journal >> /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-0000000000029223-0005b29e02b050de.journal >> /home/systemxxx_all.log
journalctl --file system@d62db8d1cdfd4c54a01f9dafba710337-000000000002968e-0005b29e02b09d43.journal >> /home/systemxxx_all.log
journalctl --file system.journal >> /home/systemxxx_all.log

Activity

  1. syyhao1994 commented on Dec 18, 2020

    @syyhao1994
    ContributorAuthor

    This problem didn't exist because we skipped many logs before, but now we don't skip that logs anymore because they actually have different seqnum. So i make a modify for skipping the repeating logs at the conjunction of the .journal files.

  2. poettering commented on Feb 17, 2021

    @poettering
    Member

    Hmm, why would the last entry in the old journal and the first in the new journal file be identical though? Did you figure that out?

  3. added a commit that references this issue on Feb 17, 2021
    c0b8bef
  4. poettering commented on Feb 17, 2021

    @poettering
    Member

    Hmm, why would the last entry in the old journal and the first in the new journal file be identical though? Did you figure that out?

    so i think i figured it out after all. please have a look at #18670 if it fixes the issue for you

  5. added a commit that references this issue on Feb 17, 2021
    4832e3c
  6. syyhao1994 commented on Feb 18, 2021

    @syyhao1994
    ContributorAuthor

    Hmm, why would the last entry in the old journal and the first in the new journal file be identical though? Did you figure that out?

    so i think i figured it out after all. please have a look at #18670 if it fixes the issue for you

    Thank you! I will try to test it.

  7. syyhao1994 commented on Feb 18, 2021

    @syyhao1994
    ContributorAuthor

    Hmm, why would the last entry in the old journal and the first in the new journal file be identical though? Did you figure that out?

    so i think i figured it out after all. please have a look at #18670 if it fixes the issue for you

    I tried the modification and it could solve the issue as you said! 👍
    Although the content of last entry in [email protected] and the beginning entry in the [email protected] are the same, but the beginning entry in the [email protected] would be skipped when i used journalctl to get all the journald logs.

    But what confused me is that why we failed to insert journal entry to the last of [email protected] but we could still get the log by using journactl --file [email protected]?

  8. added a commit that references this issue on Feb 18, 2021
    0eaee82
  9. added a commit that references this issue on Apr 1, 2021
    06cd029
  10. added a commit that references this issue on Apr 23, 2021
    ece90d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions