Bug 702334

Summary: No change in 'Next Sync' time after triggering individual repo sync.
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Sachin Ghai <sghai>
Component: ToolsAssignee: Jay Dobies <jason.dobies>
Status: CLOSED NOTABUG QA Contact: wes hayutin <whayutin>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.0CC: pthomas, tsanders
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-09 17:45:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 698226    

Description Sachin Ghai 2011-05-05 11:16:02 UTC
Description of problem:
Next sync time doesn't change even after triggering the individual repo sync.

By default its shows an interval time of 6 hours.

Here sync has been finished and "Next sync" will be at 18:6 
========================================================

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 14:15:22
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
05-05-2011 18:6              05-05-2011 08:43             finished   

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
05-05-2011 18:6              05-05-2011 08:43             finished   



Then I triggered the individual sync again with 'sr'
===========================================================

                                     Connected: dhcp193-157.pnq.redhat.com

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Synchronization Status =-

   dr  display repo synchronization schedules
   sr  trigger an individual repository sync
   dc  display CDS synchronization schedules
   sc  trigger an individual CDS sync

                                         Connected: dhcp193-157.pnq.redhat.com
------------------------------------------------------------------------------
rhui (sync) => sr

Select one or more repositories to schedule to be synchronized before its scheduled time.
The sync will happen as soon as possible depending on other tasks that may be executing
in the RHUI. Only repositories that are not currently synchronizing are displayed.

         Last Result   Next Sync         Repository
         ------------------------------------------
  -  1 : finished  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
  -  2 : finished  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Enter value from (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-2

Select one or more repositories to schedule to be synchronized before its scheduled time.
The sync will happen as soon as possible depending on other tasks that may be executing
in the RHUI. Only repositories that are not currently synchronizing are displayed.

         Last Result   Next Sync         Repository
         ------------------------------------------
  x  1 : finished  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
  x  2 : finished  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Enter value from (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


The following repositories will be scheduled for synchronization:
  Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
  Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Proceed? (y/n) y


Scheduling sync for Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)...
... successfully scheduled for the next available timeslot.
Scheduling sync for Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)...
... successfully scheduled for the next available timeslot.

------------------------------------------------------------------------------


then again I checked the status:
======================================

rhui (sync) => dr

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 14:16:10
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
05-05-2011 18:6              05-05-2011 08:45             finished   

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
05-05-2011 18:6              05-05-2011 08:45             finished   





Version-Release number of selected component (if applicable):
pulp 0.171
rhui-tool 2.0.22

How reproducible:
Always

Steps to Reproduce:
1. Add a repo
2. select 'dr' to check the sync status
3. use 'sr' for triggering the individual repo sync
  
Actual results:
Next sync time remains same even after triggering the individual repo sync.

Expected results:
Next sync time should change.

Additional info:

I changed the "repo sync frequency to "1" in rhui-tools.conf. This is just start the sync in interval time of 1 hour.

Also I restarted the "pulp-server" service. The restart of "pulp-server' service has changed the status of repos from 'finished' to 'scheduled'

Then I trigger the repo sync with "sr" and "next sync" time still remains as below:


rhui (sync) => dr

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 16:13:25
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
05-05-2011 18:6              05-05-2011 08:46             scheduled  

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
05-05-2011 18:6              05-05-2011 08:46             scheduled  


                                         Connected: dhcp193-157.pnq.redhat.com
------------------------------------------------------------------------------
^Crhui (sync) => sr

Select one or more repositories to schedule to be synchronized before its scheduled time.
The sync will happen as soon as possible depending on other tasks that may be executing
in the RHUI. Only repositories that are not currently synchronizing are displayed.

         Last Result   Next Sync         Repository
         ------------------------------------------
  -  1 : scheduled  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
  -  2 : scheduled  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Enter value from (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1-2

Select one or more repositories to schedule to be synchronized before its scheduled time.
The sync will happen as soon as possible depending on other tasks that may be executing
in the RHUI. Only repositories that are not currently synchronizing are displayed.

         Last Result   Next Sync         Repository
         ------------------------------------------
  x  1 : scheduled  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
  x  2 : scheduled  05-05-2011 18:6   Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Enter value from (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


The following repositories will be scheduled for synchronization:
  Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
  Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Proceed? (y/n) y


Scheduling sync for Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)...
... successfully scheduled for the next available timeslot.
Scheduling sync for Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)...
... successfully scheduled for the next available timeslot.

------------------------------------------------------------------------------
rhui (sync) => dr



------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 16:13:35
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
05-05-2011 18:6              05-05-2011 08:46             scheduled  

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
05-05-2011 18:6              05-05-2011 08:46             scheduled  


                                         Connected: dhcp193-157.pnq.redhat.com
------------------------------------------------------------------------------
^Crhui (sync) => 
rhui (sync) => 
rhui (sync) => dr


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 16:14:24
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
05-05-2011 18:6              05-05-2011 10:43             finished   

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
05-05-2011 18:6              05-05-2011 10:43             finished   


                                         Connected: dhcp193-157.pnq.redhat.com
------------------------------------------------------------------------------
^Crhui (sync) =>


Finally I tried to change the repo sync time in minutes by editing the
/usr/lib/python2.6/site-packages/rhui/tools/pulp-api.py file for create_redhat_repo method :

schedule = {
#            'interval' : {'hours' : int(sync_frequency_in_hours)},
            'interval' : {'minutes' : 3},
            'start_time': {'year': now.year, 'month': now.month, 'day':
now.day, 'hour': now.hour, 'minute': now.minute},
        }


this is to sync the repo in every 3 minutes.. but no luck.. and 'next sync' time still remains same.

Comment 1 Jay Dobies 2011-05-09 17:45:42 UTC
This is the intended behavior. An individual sync is a one-off operation and will not affect the schedules.