Empty suffix dirs in accounts and and containers are never removed

Bug #768816 reported by gholt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Medium
David Goetz

Bug Description

When the db_replicator reclaims old deleted account and container dbs it never attempts to remove the suffix or partition dirs.

For example, on a production system I ran the following script:

import os
empty_partition_dir_count = 0
not_empty_partition_dir_count = 0
empty_suffix_dir_count = 0
not_empty_suffix_dir_count = 0
for partition in os.listdir('containers'):
        partition_dir = os.path.join('containers', partition)
        found_any_file = False
        for suffix in os.listdir(partition_dir):
                suffix_dir = os.path.join(partition_dir, suffix)
                if not os.listdir(suffix_dir):
                        empty_suffix_dir_count += 1
                else:
                        not_empty_suffix_dir_count += 1
                        found_any_file = True
        if found_any_file:
                not_empty_partition_dir_count += 1
        else:
                empty_partition_dir_count += 1
print empty_suffix_dir_count, 'empty suffix dirs'
print not_empty_suffix_dir_count, 'not empty suffix dirs'
print empty_partition_dir_count, 'empty partition dirs'
print not_empty_partition_dir_count, 'not empty partition dirs'

And got the following result (for just one drive's containers dir):

2516 empty suffix dirs
3462 not empty suffix dirs
504 empty partition dirs
748 not empty partition dirs

Changed in swift:
assignee: nobody → David Goetz (david-goetz)
Revision history for this message
Samuel Merritt (torgomatic) wrote :

Fixed in b5509b1, I think.

Changed in swift:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.7.5
status: Fix Committed → Fix Released
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.