Reconstructor once mode doesn't aggregate reconstruction_last/time

Bug #1712461 reported by Kota Tsuyuzaki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
New
Undecided
Unassigned

Bug Description

When we run the object-reconstructor with once and multiple workers mode (e.g. reconstructor_workers = 2) like "swift-object-reconstructor /etc/swift/object-server/1.conf.d --once", the reconstructor reports per_disk stat like:

{"object_reconstruction_per_disk": {"sdb1": {"object_reconstruction_last": 1503453604.363095, "object_reconstruction_time": 7.956425348917643e-05, "pid": 6112}, "sdb5": {"object_reconstruction_last": 1503453604.374259, "object_reconstruction_time": 0.00025614897410074867, "pid": 6111}}}

However, we cannot find the aggregation stat at the root node in the dict that will be created by parent process periodically when we run the reconstructor as *FOREVER* mode.

And then, as told as above, that lost of aggregation happens "once" mode so that it won't be created forever.

I think the possible solution is likely:

diff --git a/swift/common/daemon.py b/swift/common/daemon.py
index 141027c..72da20b 100644
--- a/swift/common/daemon.py
+++ b/swift/common/daemon.py
@@ -228,6 +228,8 @@ class DaemonStrategy(object):
                     self.logger.notice('Finished %s', os.getpid())
                     break
             time.sleep(0.1)
+ # force the aggregation before exiting
+ self.daemon.aggregate_recon_update()
         return 0

     def cleanup(self):

Though, I just run "swift-object-reconstructor --once", not yet run the all unit tests.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.