From 5bb3ea162c7cd264d0c434bc8ac8240f964d2904 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Thu, 9 Feb 2017 23:17:17 -0800 Subject: [PATCH] Ignore cache files when comparing synced parts Prior to the Related-Change no suffixes were written to hashes.invalid until after initial suffix hashing created hashes.pkl - and in our probe test the only updates to the partition occurred before replication. Before the related change with sync_method = rsync it was possible when starting from a clean slate to write data, and replicate from a handoff partition without generating a hashes.invalid file in any primary. After the Related-Change it was no longer possible to write data without generating a hashes.invalid file; however with sync_method = rsync the replicator could still replicate data into a partition that never received an update directly and therefore no hashes.invalid. When using sync_method = ssync replication updates the hashes.invalid like any normal update to the partition and therefore all partitions always have a hashes.invalid. This change opts to ignores these implementation details in the probe tests when comparing the files between synced partitions by black-listing these known cache files and only validates that the disk file's on disk files are in sync. Related-Change-Id: I2b48238d9d684e831d9777a7b18f91a3cef57cd1 Change-Id: Ia9c50d7bc1a74a17c608a3c3cfb8f93196fb709d Closes-Bug: #1663021 --- test/probe/test_replication_servers_working.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/probe/test_replication_servers_working.py b/test/probe/test_replication_servers_working.py index d8b3915fa4..c486f93c67 100644 --- a/test/probe/test_replication_servers_working.py +++ b/test/probe/test_replication_servers_working.py @@ -26,6 +26,8 @@ from swift.obj.diskfile import get_data_dir from test.probe.common import ReplProbeTest from swift.common.utils import readconf +EXCLUDE_FILES = ['hashes.pkl', 'hashes.invalid', '.lock'] + def collect_info(path_list): """ @@ -41,6 +43,7 @@ def collect_info(path_list): temp_files_list = [] temp_dir_list = [] for root, dirs, files in os.walk(path): + files = [f for f in files if f not in EXCLUDE_FILES] temp_files_list += files temp_dir_list += dirs files_list.append(temp_files_list)