compareReplicationSets returns the list of instance addresses which differ between the two sets.
(first, second ReplicationSet)
| 2931 | |
| 2932 | // compareReplicationSets returns the list of instance addresses which differ between the two sets. |
| 2933 | func compareReplicationSets(first, second ReplicationSet) (added, removed []string) { |
| 2934 | for _, instance := range first.Instances { |
| 2935 | if !second.Includes(instance.Addr) { |
| 2936 | added = append(added, instance.Addr) |
| 2937 | } |
| 2938 | } |
| 2939 | |
| 2940 | for _, instance := range second.Instances { |
| 2941 | if !first.Includes(instance.Addr) { |
| 2942 | removed = append(removed, instance.Addr) |
| 2943 | } |
| 2944 | } |
| 2945 | |
| 2946 | return |
| 2947 | } |
| 2948 | |
| 2949 | // This test verifies that ring is getting updates, even after extending check in the loop method. |
| 2950 | func TestRingUpdates(t *testing.T) { |
no test coverage detected