Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1793846

Summary: CinderCronDbPurgeMaxDelay is not applied
Product: Red Hat OpenStack Reporter: Takashi Kajinami <tkajinam>
Component: openstack-tripleo-heat-templatesAssignee: Alan Bishop <abishop>
Status: CLOSED ERRATA QA Contact: Sasha Smolyak <ssmolyak>
Severity: medium Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: aschultz, gfidente, ltoscano, mburns, mgarciac, tshefi
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-8.4.1-58.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-24 11:33:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Takashi Kajinami 2020-01-22 04:09:53 UTC
Description of problem:

In the latest openstack-tripleo-heat-templates, we have CinderCronDbPurgeMaxDelay to configure
Max Delay in cinder cronb purge job.

/usr/share/openstack-tripleo-heat-templates/puppet/services/cinder-base.yaml
~~~
  CinderCronDbPurgeMaxDelay:
    type: string
    description: >
        Cron to move deleted instances to another table - Max Delay
    default: '3600'
~~~

The parameter should have 3600 by default, but it is not applied on controllers.

~~~
[heat-admin@controller-0 ~]$ sudo cat /var/lib/config-data/puppet-generated/cinder/var/spool/cron/cinder
# HEADER: This file was autogenerated at 2020-01-18 10:53:55 +0000 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: cinder-manage db purge
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
1 0 * * * cinder-manage db purge 30 >>/var/log/cinder/cinder-rowsflush.log 2>&1
~~~

Version-Release number of selected component (if applicable):
 openstack-tripleo-heat-templates-8.4.1-16.el7ost.noarch
 puppet-cinder-12.4.1-5.el7ost.noarch

How reproducible:
Always

Steps to Reproduce:
1. Deploy overcloud
2. See /var/lib/config-data/puppet-generated/cinder/var/spool/cron/cinder

Actual results:
The cron job doesn't have randomized sleep by default

Expected results:
The cron job has randomized sleep by default

Additional info:

Comment 1 Alan Bishop 2020-01-28 15:30:03 UTC
Upstream patch has already merged on stable/queens.

Comment 8 Tzach Shefi 2020-06-09 07:52:19 UTC
Verified on:
openstack-tripleo-heat-templates-8.4.1-58.el7ost.noarch

Looked at a controller, we now do get random and 3600 set: 
 
[root@controller-0 ~]# cat /var/lib/config-data/puppet-generated/cinder/var/spool/cron/cinder
# HEADER: This file was autogenerated at 2020-05-24 06:45:05 +0000 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: cinder-manage db purge
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
1 0 * * * sleep `expr ${RANDOM} \% 3600`; cinder-manage db purge 30 >>/var/log/cinder/cinder-rowsflush.log 2>&1

Good to verify.

Comment 10 errata-xmlrpc 2020-06-24 11:33:20 UTC
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/RHBA-2020:2718