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.
Bug 1504627 - rsyslog doesn't remove unusable disk queue files upon start
Summary: rsyslog doesn't remove unusable disk queue files upon start
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rsyslog
Version: 6.9
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jiří Vymazal
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1504633
TreeView+ depends on / blocked
 
Reported: 2017-10-20 10:41 UTC by Renaud Métrich
Modified: 2020-12-14 10:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1504633 (view as bug list)
Environment:
Last Closed: 2017-10-31 07:15:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1507028 0 low CLOSED recover_qi.pl script is undocumented 2021-02-22 00:41:40 UTC

Internal Links: 1507028

Description Renaud Métrich 2017-10-20 10:41:03 UTC
Description of problem:

When forwarding logs to a remote server and that server is not reachable for some time, logs are queued to disk.
Upon remote server being reachable again, the logs are transmitted.

However, if rsyslog crashes for some reason or system is abruptly restarted (i.e. without rsyslog shutting down gracefully), upon restart of rsyslog, the disk queue files are not removed, because there is no associated ".qi" file.


Version-Release number of selected component (if applicable):

rsyslog-5.8.10-10.el6_6.x86_64 but affects also other newer releases (7.x, 8.x)


How reproducible:

Always


Steps to Reproduce:
1. Set up forwarding on vm-rsyslog69-client to vm-rsyslog74-server

(vm-rsyslog69-client) Excerpt of /etc/rsyslog.conf

# Disk Assisted Config
$ActionQueueType LinkedList
$WorkDirectory /var/lib/rsyslog
$ActionQueueSize 100000
$ActionQueueFileName diskqueue
$ActionQueueMaxDiskSpace 1G
$ActionQueueSaveOnShutdown on
$ActionResumeRetryCount -1
$ActionResumeInterval 10
$ActionQueueLowWatermark 200
$ActionQueueHighWatermark 600
*.info @@vm-rsyslog74-server:514

(vm-rsyslog74-server) Excerpt of /etc/rsyslog.conf

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514


2. Generate logs from vm-rsyslog69-client

(vm-rsyslog69-client) # i=1; while :; do logger "HEY $(printf "%05d" $i) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; sleep 0.1; i=$(($i+1)); done


3. After some time, stop rsyslog on remote server

(vm-rsyslog74-server) # systemctl stop rsyslog


4. Wait for vm-rsyslog69-client to queue logs on disk

(vm-rsyslog69-client) # watch ls -l /var/lib/rsyslog
total 216
-rw-------. 1 root root 217799 Oct 20 12:06 diskqueue.00000001


5. Start rsyslog on remote server

(vm-rsyslog74-server) # systemctl start rsyslog


6. Stop generating logs from vm-rsyslog69-client 

(vm-rsyslog69-client) ^C


7. Kill rsyslog or reboot system abruptly


Additional info:

Since there is no ".qi" file, rsyslog will not remove the unusable disk queue files, consuming disk space.
Because the ".qi" file is only created when rsyslog gracefully shut downs, logs will not be sent to remote server (in case remote server was unreachable while the client system rebooted abruptly).

As an improvment, the ".qi" file may be created as soon as disk queueing happens, and removed once disk queue gets empty.
By doing so, upon start of rsyslog, rsyslog may safely delete queue files which do not have a corresponding ".qi" file.


Note You need to log in before you can comment on or make changes to this bug.