Object replicator still replicate a single partition even when max connection reached on remote node

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

Bug Description

When the object node's rsync max connection is reached, the REPLICATE request is still going to
be sent to the remote object node to replicate the single partition regardless the sync function failed.

This caused unnecessary load on the remote object nodes which potentially increase the object
server latency.

The update_delete() function in swift/swift/obj/replicator.py handles the sync failure properly
and it only send the REPLICATE request if sync is successful. Needs to handle the sync() return
code in the similar way.

Revision history for this message
Alan Jiang (ajiang) wrote :

                      hashed, recalc_hash = tpool_reraise(
                        get_hashes,
                        job['path'], recalculate=suffixes,
                        reclaim_age=self.reclaim_age)
                    self.logger.update_stats('suffix.hashes', hashed)
                    local_hash = recalc_hash
                    suffixes = [suffix for suffix in local_hash if
                                local_hash[suffix] !=
                                remote_hash.get(suffix, -1)]
                    success, _junk = self.sync(node, job, suffixes) <<<<<<<<<<<<<<<<<<<<
                   >>>>> Need to inspect success and only call REPLICATE if sync successfully <<<<<<<<<<<<
                    with Timeout(self.http_timeout):
                        conn = http_connect(
                            node['replication_ip'], node['replication_port'],
                            node['device'], job['partition'], 'REPLICATE',
                            '/' + '-'.join(suffixes),
                            headers=self.headers)
                        conn.getresponse().read()
                    # add only remote region when replicate succeeded
                    if success and node['region'] != job['region']:
                        synced_remote_regions.add(node['region'])
                    self.suffix_sync += len(suffixes)
                    self.logger.update_stats('suffix.syncs', len(suffixes))

Changed in swift:
assignee: nobody → Roman Vasilets (rvasilets)
Changed in swift:
assignee: Roman Vasilets (rvasilets) → nobody
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.