Repository navigation
Description
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.
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.
- 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
syyhao1994 commentedon Dec 18, 2020
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.
poettering commentedon Feb 17, 2021
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?
journald: when we fail to add a new entry to a journal, return the seqno
poettering commentedon Feb 17, 2021
so i think i figured it out after all. please have a look at #18670 if it fixes the issue for you
journald: when we fail to add a new entry to a journal, return the seqno
syyhao1994 commentedon Feb 18, 2021
Thank you! I will try to test it.
syyhao1994 commentedon Feb 18, 2021
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]?
journald: when we fail to add a new entry to a journal, return the seqno
journald: when we fail to add a new entry to a journal, return the seqno
journald: when we fail to add a new entry to a journal, return the seqno