Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

more ranges => segments

Splitting test projects to unit, integration and ClusterTests
Finished integration on online backup strategies even from the master side.


git-svn-id: https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/experiments/dht/dht@2184 079b0acf-d9fa-0310-9935-e5ade295c882
  • Loading branch information...
commit a7269f66c3a3484569ff00fe2e2f40c305232d00 1 parent cdd5a19
authored

Showing 27 changed files with 328 additions and 147 deletions. Show diff stats Hide diff stats

  1. 0  {Rhino.DistributedHashTable.IntegrationTests → Rhino.DistributedHashTable.ClusterTests}/ClusterTests.cs
  2. 0  ...istributedHashTable.IntegrationTests → Rhino.DistributedHashTable.ClusterTests}/FullIntegrationTest.cs
  3. 0  ...stributedHashTable.IntegrationTests → Rhino.DistributedHashTable.ClusterTests}/MasterOverTheNetwork.cs
  4. 0  ...DistributedHashTable.IntegrationTests → Rhino.DistributedHashTable.ClusterTests}/NodeOverTheNetwork.cs
  5. 36  Rhino.DistributedHashTable.ClusterTests/Properties/AssemblyInfo.cs
  6. 80  Rhino.DistributedHashTable.ClusterTests/Rhino.DistributedHashTable.ClusterTests.csproj
  7. 0  Rhino.DistributedHashTable.IntegrationTests/{Mini → }/DistributedHashTableReplicationTest.cs
  8. 0  Rhino.DistributedHashTable.IntegrationTests/{Mini → }/DistributedHashTableStorageTest.cs
  9. 0  Rhino.DistributedHashTable.IntegrationTests/{Mini → }/EsentTestBase.cs
  10. 0  Rhino.DistributedHashTable.IntegrationTests/{Mini → }/OnlineRangeReplicationCommandTest.cs
  11. 15  Rhino.DistributedHashTable.IntegrationTests/Rhino.DistributedHashTable.IntegrationTests.csproj
  12. 15  Rhino.DistributedHashTable.IntegrationTests/app.config
  13. 21  Rhino.DistributedHashTable.Tests/MasterCaughtUpBehavior.cs
  14. 17  Rhino.DistributedHashTable.Tests/MasterGaveUpBehavior.cs
  15. 6  Rhino.DistributedHashTable.sln
  16. 4  Rhino.DistributedHashTable/Client/DistributedHashTableMasterClient.cs
  17. 8  Rhino.DistributedHashTable/Client/DistributedHashTableStorageClient.cs
  18. 32  Rhino.DistributedHashTable/Commands/OnlineRangeReplicationCommand.cs
  19. 8  Rhino.DistributedHashTable/Commands/RearrangeBackups.cs
  20. 135  Rhino.DistributedHashTable/Internal/DistributedHashTableMaster.cs
  21. 20  Rhino.DistributedHashTable/Internal/DistributedHashTableNode.cs
  22. 10  Rhino.DistributedHashTable/Internal/IDistributedHashTableMaster.cs
  23. 10  Rhino.DistributedHashTable/Internal/IDistributedHashTableNode.cs
  24. 16  Rhino.DistributedHashTable/Internal/Topology.cs
  25. 20  Rhino.DistributedHashTable/Remote/DistributedHashTableNodeReplication.cs
  26. 16  Rhino.DistributedHashTable/Remote/IDistributedHashTableNodeReplication.cs
  27. 6  Rhino.DistributedHashTable/Todo.txt
0  ...ributedHashTable.IntegrationTests/ClusterTests.cs → ...DistributedHashTable.ClusterTests/ClusterTests.cs
File renamed without changes
0  ...HashTable.IntegrationTests/FullIntegrationTest.cs → ...utedHashTable.ClusterTests/FullIntegrationTest.cs
File renamed without changes
0  ...ashTable.IntegrationTests/MasterOverTheNetwork.cs → ...tedHashTable.ClusterTests/MasterOverTheNetwork.cs
File renamed without changes
0  ...dHashTable.IntegrationTests/NodeOverTheNetwork.cs → ...butedHashTable.ClusterTests/NodeOverTheNetwork.cs
File renamed without changes
36  Rhino.DistributedHashTable.ClusterTests/Properties/AssemblyInfo.cs
... ...
@@ -0,0 +1,36 @@
  1
+using System.Reflection;
  2
+using System.Runtime.CompilerServices;
  3
+using System.Runtime.InteropServices;
  4
+
  5
+// General Information about an assembly is controlled through the following 
  6
+// set of attributes. Change these attribute values to modify the information
  7
+// associated with an assembly.
  8
+[assembly: AssemblyTitle("Rhino.DistributedHashTable.ClusterTests")]
  9
+[assembly: AssemblyDescription("")]
  10
+[assembly: AssemblyConfiguration("")]
  11
+[assembly: AssemblyCompany("Microsoft")]
  12
+[assembly: AssemblyProduct("Rhino.DistributedHashTable.ClusterTests")]
  13
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
  14
+[assembly: AssemblyTrademark("")]
  15
+[assembly: AssemblyCulture("")]
  16
+
  17
+// Setting ComVisible to false makes the types in this assembly not visible 
  18
+// to COM components.  If you need to access a type in this assembly from 
  19
+// COM, set the ComVisible attribute to true on that type.
  20
+[assembly: ComVisible(false)]
  21
+
  22
+// The following GUID is for the ID of the typelib if this project is exposed to COM
  23
+[assembly: Guid("0cedc767-aa73-481b-ac16-ad6d5d4cace9")]
  24
+
  25
+// Version information for an assembly consists of the following four values:
  26
+//
  27
+//      Major Version
  28
+//      Minor Version 
  29
+//      Build Number
  30
+//      Revision
  31
+//
  32
+// You can specify all the values or you can default the Build and Revision Numbers 
  33
+// by using the '*' as shown below:
  34
+// [assembly: AssemblyVersion("1.0.*")]
  35
+[assembly: AssemblyVersion("1.0.0.0")]
  36
+[assembly: AssemblyFileVersion("1.0.0.0")]
80  Rhino.DistributedHashTable.ClusterTests/Rhino.DistributedHashTable.ClusterTests.csproj
... ...
@@ -0,0 +1,80 @@
  1
+<?xml version="1.0" encoding="utf-8"?>
  2
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3
+  <PropertyGroup>
  4
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  5
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  6
+    <ProductVersion>9.0.30729</ProductVersion>
  7
+    <SchemaVersion>2.0</SchemaVersion>
  8
+    <ProjectGuid>{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}</ProjectGuid>
  9
+    <OutputType>Library</OutputType>
  10
+    <AppDesignerFolder>Properties</AppDesignerFolder>
  11
+    <RootNamespace>Rhino.DistributedHashTable.ClusterTests</RootNamespace>
  12
+    <AssemblyName>Rhino.DistributedHashTable.ClusterTests</AssemblyName>
  13
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  14
+    <FileAlignment>512</FileAlignment>
  15
+  </PropertyGroup>
  16
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  17
+    <DebugSymbols>true</DebugSymbols>
  18
+    <DebugType>full</DebugType>
  19
+    <Optimize>false</Optimize>
  20
+    <OutputPath>bin\Debug\</OutputPath>
  21
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
  22
+    <ErrorReport>prompt</ErrorReport>
  23
+    <WarningLevel>4</WarningLevel>
  24
+  </PropertyGroup>
  25
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  26
+    <DebugType>pdbonly</DebugType>
  27
+    <Optimize>true</Optimize>
  28
+    <OutputPath>bin\Release\</OutputPath>
  29
+    <DefineConstants>TRACE</DefineConstants>
  30
+    <ErrorReport>prompt</ErrorReport>
  31
+    <WarningLevel>4</WarningLevel>
  32
+  </PropertyGroup>
  33
+  <ItemGroup>
  34
+    <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
  35
+      <SpecificVersion>False</SpecificVersion>
  36
+      <HintPath>..\Rhino.DistributedHashTable\bin\Debug\log4net.dll</HintPath>
  37
+    </Reference>
  38
+    <Reference Include="System" />
  39
+    <Reference Include="System.Core">
  40
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
  41
+    </Reference>
  42
+    <Reference Include="System.Xml.Linq">
  43
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
  44
+    </Reference>
  45
+    <Reference Include="System.Data.DataSetExtensions">
  46
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
  47
+    </Reference>
  48
+    <Reference Include="System.Data" />
  49
+    <Reference Include="System.Xml" />
  50
+    <Reference Include="xunit, Version=1.1.0.1323, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
  51
+      <SpecificVersion>False</SpecificVersion>
  52
+      <HintPath>..\Rhino.DistributedHashTable.Tests\bin\Debug\xunit.dll</HintPath>
  53
+    </Reference>
  54
+  </ItemGroup>
  55
+  <ItemGroup>
  56
+    <Compile Include="ClusterTests.cs" />
  57
+    <Compile Include="FullIntegrationTest.cs" />
  58
+    <Compile Include="MasterOverTheNetwork.cs" />
  59
+    <Compile Include="NodeOverTheNetwork.cs" />
  60
+    <Compile Include="Properties\AssemblyInfo.cs" />
  61
+  </ItemGroup>
  62
+  <ItemGroup>
  63
+    <ProjectReference Include="..\..\pht\Rhino.PersistentHashTable\Rhino.PersistentHashTable.csproj">
  64
+      <Project>{F30B2D63-CED5-4C8A-908F-0B5503D984A9}</Project>
  65
+      <Name>Rhino.PersistentHashTable</Name>
  66
+    </ProjectReference>
  67
+    <ProjectReference Include="..\Rhino.DistributedHashTable\Rhino.DistributedHashTable.csproj">
  68
+      <Project>{4E8D44D2-505D-488C-B92C-51147748B104}</Project>
  69
+      <Name>Rhino.DistributedHashTable</Name>
  70
+    </ProjectReference>
  71
+  </ItemGroup>
  72
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  73
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
  74
+       Other similar extension points exist, see Microsoft.Common.targets.
  75
+  <Target Name="BeforeBuild">
  76
+  </Target>
  77
+  <Target Name="AfterBuild">
  78
+  </Target>
  79
+  -->
  80
+</Project>
0  ...Tests/Mini/DistributedHashTableReplicationTest.cs → ...ationTests/DistributedHashTableReplicationTest.cs
File renamed without changes
0  ...tionTests/Mini/DistributedHashTableStorageTest.cs → ...tegrationTests/DistributedHashTableStorageTest.cs
File renamed without changes
0  ...dHashTable.IntegrationTests/Mini/EsentTestBase.cs → ...ibutedHashTable.IntegrationTests/EsentTestBase.cs
File renamed without changes
0  ...onTests/Mini/OnlineRangeReplicationCommandTest.cs → ...grationTests/OnlineRangeReplicationCommandTest.cs
File renamed without changes
15  Rhino.DistributedHashTable.IntegrationTests/Rhino.DistributedHashTable.IntegrationTests.csproj
@@ -60,15 +60,11 @@
60 60
     </Reference>
61 61
   </ItemGroup>
62 62
   <ItemGroup>
63  
-    <Compile Include="ClusterTests.cs" />
64  
-    <Compile Include="FullIntegrationTest.cs" />
65  
-    <Compile Include="MasterOverTheNetwork.cs" />
66  
-    <Compile Include="Mini\DistributedHashTableReplicationTest.cs" />
67  
-    <Compile Include="Mini\DistributedHashTableStorageTest.cs" />
68  
-    <Compile Include="Mini\EsentTestBase.cs" />
69  
-    <Compile Include="Mini\OnlineRangeReplicationCommandTest.cs" />
  63
+    <Compile Include="DistributedHashTableReplicationTest.cs" />
  64
+    <Compile Include="DistributedHashTableStorageTest.cs" />
  65
+    <Compile Include="EsentTestBase.cs" />
  66
+    <Compile Include="OnlineRangeReplicationCommandTest.cs" />
70 67
     <Compile Include="Properties\AssemblyInfo.cs" />
71  
-    <Compile Include="NodeOverTheNetwork.cs" />
72 68
   </ItemGroup>
73 69
   <ItemGroup>
74 70
     <ProjectReference Include="..\..\pht\Rhino.PersistentHashTable\Rhino.PersistentHashTable.csproj">
@@ -80,9 +76,6 @@
80 76
       <Name>Rhino.DistributedHashTable</Name>
81 77
     </ProjectReference>
82 78
   </ItemGroup>
83  
-  <ItemGroup>
84  
-    <None Include="app.config" />
85  
-  </ItemGroup>
86 79
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
87 80
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
88 81
        Other similar extension points exist, see Microsoft.Common.targets.
15  Rhino.DistributedHashTable.IntegrationTests/app.config
... ...
@@ -1,15 +0,0 @@
1  
-<configuration>
2  
-	<system.diagnostics>
3  
-		<sources>
4  
-			<source name="System.ServiceModel"
5  
-							switchValue="Information, ActivityTracing"
6  
-							propagateActivity="true">
7  
-				<listeners>
8  
-					<add name="traceListener"
9  
-							type="System.Diagnostics.XmlWriterTraceListener"
10  
-							initializeData= "Traces.svclog" />
11  
-				</listeners>
12  
-			</source>
13  
-		</sources>
14  
-	</system.diagnostics>
15  
-</configuration>
21  Rhino.DistributedHashTable.Tests/MasterCaughtUpBehavior.cs
@@ -28,6 +28,27 @@ public void WillRaiseTopologyChangedEvent()
28 28
 				master.CaughtUp(endPoint, ReplicationType.Ownership, ranges.First().Index);
29 29
 				Assert.True(wasCalled);
30 30
 			}
  31
+
  32
+			[Fact]
  33
+			public void WhenCatchingUpOnBackupsWillMoveFromPendingBackupsToBackups()
  34
+			{
  35
+				master.CaughtUp(endPoint, ReplicationType.Ownership,
  36
+				                master.Join(endPoint).Select(x => x.Index).ToArray());
  37
+
  38
+				var anotherEndpoint = NodeEndpoint.ForTest(54);
  39
+				master.CaughtUp(anotherEndpoint, ReplicationType.Ownership,
  40
+				                master.Join(anotherEndpoint).Select(x => x.Index).ToArray());
  41
+
  42
+				var segment = master.Topology.Segments.First(x => x.PendingBackups.Count > 0);
  43
+
  44
+				master.CaughtUp(segment.PendingBackups.First(), ReplicationType.Backup,
  45
+				                segment.Index);
  46
+
  47
+				segment = master.Topology.Segments[segment.Index];
  48
+
  49
+				Assert.Empty(segment.PendingBackups);
  50
+				Assert.Equal(1, segment.Backups.Count);
  51
+			}
31 52
 		}
32 53
 	}
33 54
 }
17  Rhino.DistributedHashTable.Tests/MasterGaveUpBehavior.cs
@@ -32,6 +32,23 @@ public void WillRemoveThePendingMoveFromTheSegment()
32 32
 
33 33
 				Assert.Null(range.InProcessOfMovingToEndpoint);
34 34
 			}
  35
+
  36
+			[Fact]
  37
+			public void WhenGivingUpOnBackupsWillRemoveFromPendingBackups()
  38
+			{
  39
+				master.CaughtUp(endPoint, ReplicationType.Ownership,
  40
+								master.Join(endPoint).Select(x => x.Index).ToArray());
  41
+
  42
+				var segment = master.Topology.Segments.First(x => x.PendingBackups.Count > 0);
  43
+
  44
+				master.GaveUp(segment.PendingBackups.First(), ReplicationType.Backup,
  45
+								segment.Index);
  46
+
  47
+				segment = master.Topology.Segments[segment.Index];
  48
+
  49
+				Assert.Empty(segment.PendingBackups);
  50
+				Assert.Equal(0, segment.Backups.Count);
  51
+			}
35 52
 		}
36 53
 	}
37 54
 }
6  Rhino.DistributedHashTable.sln
@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.Queues", "..\queues\R
15 15
 EndProject
16 16
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.Queues.Tests", "..\queues\Rhino.Queues.Tests\Rhino.Queues.Tests.csproj", "{98D394CA-9FEF-49AD-8DAB-FE039152E001}"
17 17
 EndProject
  18
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.DistributedHashTable.ClusterTests", "Rhino.DistributedHashTable.ClusterTests\Rhino.DistributedHashTable.ClusterTests.csproj", "{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}"
  19
+EndProject
18 20
 Global
19 21
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 22
 		Debug|Any CPU = Debug|Any CPU
@@ -49,6 +51,10 @@ Global
49 51
 		{98D394CA-9FEF-49AD-8DAB-FE039152E001}.Debug|Any CPU.Build.0 = Debug|Any CPU
50 52
 		{98D394CA-9FEF-49AD-8DAB-FE039152E001}.Release|Any CPU.ActiveCfg = Release|Any CPU
51 53
 		{98D394CA-9FEF-49AD-8DAB-FE039152E001}.Release|Any CPU.Build.0 = Release|Any CPU
  54
+		{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
  55
+		{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
  56
+		{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
  57
+		{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}.Release|Any CPU.Build.0 = Release|Any CPU
52 58
 	EndGlobalSection
53 59
 	GlobalSection(SolutionProperties) = preSolution
54 60
 		HideSolutionNode = FALSE
4  Rhino.DistributedHashTable/Client/DistributedHashTableMasterClient.cs
@@ -130,7 +130,7 @@ public Topology GetTopology()
130 130
 
131 131
 		public void GaveUp(NodeEndpoint endpoint,
132 132
 			ReplicationType type,
133  
-						   params int[] rangesGivingUpOn)
  133
+						   params int[] segmentsGivingUpOn)
134 134
 		{
135 135
 			Execute((writer,
136 136
 							stream) =>
@@ -140,7 +140,7 @@ public Topology GetTopology()
140 140
 					Type = MasterMessageType.GaveUpRequest,
141 141
 					GaveUp = new GaveUpRequestMessage.Builder
142 142
 					{
143  
-						GaveUpSegmentsList = { rangesGivingUpOn },
  143
+						GaveUpSegmentsList = { segmentsGivingUpOn },
144 144
 						Type = type == ReplicationType.Backup ? Protocol.ReplicationType.Backup : Protocol.ReplicationType.Ownership,
145 145
 						Endpoint = new Protocol.NodeEndpoint.Builder
146 146
 						{
8  Rhino.DistributedHashTable/Client/DistributedHashTableStorageClient.cs
@@ -171,7 +171,7 @@ public IDistributedHashTableNodeReplication Replication
171 171
 		}
172 172
 
173 173
 		public ReplicationResult ReplicateNextPage(NodeEndpoint replicationEndpoint,
174  
-		                                           int range)
  174
+		                                           int segment)
175 175
 		{
176 176
 			writer.Write(new StorageMessageUnion.Builder
177 177
 			{
@@ -183,7 +183,7 @@ public IDistributedHashTableNodeReplication Replication
183 183
 						Async = replicationEndpoint.Async.ToString(),
184 184
 						Sync = replicationEndpoint.Sync.ToString()
185 185
 					}.Build(),
186  
-					Segment = range
  186
+					Segment = segment
187 187
 				}.Build()
188 188
 			}.Build());
189 189
 			writer.Flush();
@@ -204,7 +204,7 @@ public IDistributedHashTableNodeReplication Replication
204 204
 		}
205 205
 
206 206
 		public int[] AssignAllEmptySegments(NodeEndpoint replicationEndpoint,
207  
-		                                    int[] ranges)
  207
+		                                    int[] segments)
208 208
 		{
209 209
 			writer.Write(new StorageMessageUnion.Builder
210 210
 			{
@@ -216,7 +216,7 @@ public IDistributedHashTableNodeReplication Replication
216 216
 						Async = replicationEndpoint.Async.ToString(),
217 217
                         Sync = replicationEndpoint.Sync.ToString()
218 218
 					}.Build(),
219  
-                    SegmentsList = { ranges }
  219
+                    SegmentsList = { segments }
220 220
 				}.Build()
221 221
 			}.Build());
222 222
 			writer.Flush();
32  Rhino.DistributedHashTable/Commands/OnlineRangeReplicationCommand.cs
@@ -49,10 +49,10 @@ public bool Execute()
49 49
 				return false;
50 50
 			try
51 51
 			{
52  
-				var rangesToLoad = AssignAllEmptySegmentsFromEndpoint(processedSegments);
  52
+				var segmentsToLoad = AssignAllEmptySegmentsFromEndpoint(processedSegments);
53 53
 				if (continueWorking == false)
54 54
 					return false;
55  
-				return ProcessSegmentsWithData(rangesToLoad, processedSegments) == false;
  55
+				return ProcessSegmentsWithData(segmentsToLoad, processedSegments) == false;
56 56
 			}
57 57
 			catch (Exception e)
58 58
 			{
@@ -85,23 +85,23 @@ public bool Execute()
85 85
 			}
86 86
 		}
87 87
 
88  
-		private bool ProcessSegmentsWithData(IEnumerable<Segment> rangesToLoad,
  88
+		private bool ProcessSegmentsWithData(IEnumerable<Segment> segmentsToLoad,
89 89
 										   ICollection<int> processedSegments)
90 90
 		{
91 91
 			var someFailed = false;
92 92
 			int numberOfFailures = 0;
93  
-			foreach (var range in rangesToLoad)
  93
+			foreach (var segment in segmentsToLoad)
94 94
 			{
95 95
 				if (continueWorking == false)
96 96
 					return true;
97 97
 				try
98 98
 				{
99  
-					ReplicateSegment(range);
100  
-					processedSegments.Add(range.Index);
  99
+					ReplicateSegment(segment);
  100
+					processedSegments.Add(segment.Index);
101 101
 				}
102 102
 				catch (Exception e)
103 103
 				{
104  
-					log.Error("Failed to replicate range " + range, e);
  104
+					log.Error("Failed to replicate segment " + segment, e);
105 105
 					numberOfFailures += 1;
106 106
 					if (numberOfFailures > 5)
107 107
 					{
@@ -109,25 +109,25 @@ public bool Execute()
109 109
 									   numberOfFailures);
110 110
 						break;
111 111
 					}
112  
-					node.GivingUpOn(type, range.Index);
113  
-					processedSegments.Add(range.Index);
  112
+					node.GivingUpOn(type, segment.Index);
  113
+					processedSegments.Add(segment.Index);
114 114
 					someFailed |= true;
115 115
 				}
116 116
 			}
117 117
 			return someFailed;
118 118
 		}
119 119
 
120  
-		private void ReplicateSegment(Segment range)
  120
+		private void ReplicateSegment(Segment segment)
121 121
 		{
122 122
 			while (true)
123 123
 			{
124  
-				log.DebugFormat("Starting replication of range [{0}] from {1}",
125  
-								range,
  124
+				log.DebugFormat("Starting replication of segment [{0}] from {1}",
  125
+								segment,
126 126
 								endpoint);
127 127
 
128  
-				var result = otherNode.ReplicateNextPage(node.Endpoint, range.Index);
129  
-				log.DebugFormat("Replication of range [{0}] from {1} got {2} puts & {3} removals",
130  
-								range,
  128
+				var result = otherNode.ReplicateNextPage(node.Endpoint, segment.Index);
  129
+				log.DebugFormat("Replication of segment [{0}] from {1} got {2} puts & {3} removals",
  130
+								segment,
131 131
 								endpoint,
132 132
 								result.PutRequests.Length,
133 133
 								result.RemoveRequests.Length);
@@ -141,7 +141,7 @@ private void ReplicateSegment(Segment range)
141 141
 				if (result.Done)
142 142
 					break;
143 143
 			}
144  
-			node.DoneReplicatingSegments(type, range.Index);
  144
+			node.DoneReplicatingSegments(type, segment.Index);
145 145
 		}
146 146
 
147 147
 		private List<Segment> AssignAllEmptySegmentsFromEndpoint(List<int> processedSegments)
8  Rhino.DistributedHashTable/Commands/RearrangeBackups.cs
@@ -4,7 +4,7 @@
4 4
 
5 5
 namespace Rhino.DistributedHashTable.Commands
6 6
 {
7  
-	public class RearrangeBackups
  7
+	public class RearsegmentBackups
8 8
 	{
9 9
 		private readonly HashSet<NodeEndpoint> endpoints;
10 10
 		private readonly int fairDistribution;
@@ -14,14 +14,14 @@ public class RearrangeBackups
14 14
 
15 15
 		public ICollection<BackUpAdded> Changed = new List<BackUpAdded>();
16 16
 
17  
-		public RearrangeBackups(IEnumerable<Segment> ranges,
  17
+		public RearsegmentBackups(IEnumerable<Segment> segments,
18 18
 		                        HashSet<NodeEndpoint> endpoints,
19 19
 		                        int numberOfBackCopiesToKeep)
20 20
 		{
21  
-			this.segments = ranges;
  21
+			this.segments = segments;
22 22
 			this.endpoints = endpoints;
23 23
 			this.numberOfBackCopiesToKeep = numberOfBackCopiesToKeep;
24  
-			fairDistribution = (ranges.Count() * numberOfBackCopiesToKeep) / endpoints.Count() + 1;
  24
+			fairDistribution = (segments.Count() * numberOfBackCopiesToKeep) / endpoints.Count() + 1;
25 25
 			currentDistribution = PrepareDistributions();
26 26
 		}
27 27
 
135  Rhino.DistributedHashTable/Internal/DistributedHashTableMaster.cs
@@ -39,8 +39,8 @@ public IEnumerable<NodeEndpoint> Endpoints
39 39
 
40 40
 		/// <summary>
41 41
 		/// This method is called when a new node wants to join the cluster.
42  
-		/// The result is the ranges that this node is responsible for, if it is an
43  
-		/// existing one, or the list of ranges that it needs to pull from the currently 
  42
+		/// The result is the segments that this node is responsible for, if it is an
  43
+		/// existing one, or the list of segments that it needs to pull from the currently 
44 44
 		/// assigned node.
45 45
 		/// Note:
46 46
 		/// that if it needs to pull date from the currently assigned node, it will
@@ -50,40 +50,79 @@ public IEnumerable<NodeEndpoint> Endpoints
50 50
 		public Segment[] Join(NodeEndpoint endpoint)
51 51
 		{
52 52
 			var newlyAlocatedSegments = JoinInternal(endpoint);
53  
-			RearrangeBackups();
  53
+			RearsegmentBackups();
54 54
 			LogCurrentSegmentAssignment();
55 55
 			return newlyAlocatedSegments;
56 56
 		}
57 57
 
58 58
 		/// <summary>
59  
-		/// Notify the master that the endpoint has caught up on all the specified ranges
  59
+		/// Notify the master that the endpoint has caught up on all the specified segments
60 60
 		/// </summary>
61 61
 		public void CaughtUp(NodeEndpoint endpoint,
62 62
 							 ReplicationType type,
63 63
 							 params int[] caughtUpSegments)
64 64
 		{
65  
-			if (type == ReplicationType.Ownership)
66  
-				CaughtUpOnOwnership(caughtUpSegments, endpoint);
  65
+			var matchingSegments = GetMatchingSegments(caughtUpSegments, endpoint);
  66
+
  67
+			var modifiedSegments = from segment in Segments
  68
+								   join caughtUpSegment in matchingSegments on segment.Index equals caughtUpSegment.Index into
  69
+									maybeMatchingSegment
  70
+								   select
  71
+									new MatchSegment{ Segment = segment, Matching = maybeMatchingSegment }; 
  72
+			
  73
+			switch (type)
  74
+			{
  75
+				case ReplicationType.Ownership:
  76
+					CaughtUpOnOwnership(modifiedSegments, endpoint);
  77
+					break;
  78
+                case ReplicationType.Backup:
  79
+					CaughtUpOnBackups(modifiedSegments, endpoint);
  80
+					break;
  81
+				default:
  82
+					throw new InvalidOperationException("Unknown replication type: " + type);
  83
+			}
67 84
 			LogCurrentSegmentAssignment();
68 85
 			TopologyChanged();
69 86
 		}
70 87
 
71  
-		private void CaughtUpOnOwnership(int[] caughtUpSegments,
72  
-										 NodeEndpoint endpoint)
  88
+		public class MatchSegment
73 89
 		{
74  
-			var matchingSegments = GetMatchingSegments(caughtUpSegments, endpoint);
  90
+			public Segment Segment;
  91
+			public IEnumerable<Segment> Matching;
  92
+		}
75 93
 
76  
-			var modifiedSegments = from range in Segments
77  
-								   join caughtUpSegment in matchingSegments on range.Index equals caughtUpSegment.Index into
78  
-									maybeMatchingSegment
79  
-								   select
80  
-									new { range, maybeMatchingSegment };
  94
+		private void CaughtUpOnBackups(IEnumerable<MatchSegment> modifiedSegments,
  95
+		                               NodeEndpoint endpoint)
  96
+		{
  97
+			Topology = new Topology((
  98
+			                        	from modifiedSegment in modifiedSegments
  99
+			                        	let x = modifiedSegment.Matching.FirstOrDefault()
  100
+			                        	select x == null
  101
+			                        	       	? modifiedSegment.Segment
  102
+			                        	       	: new Segment
  103
+			                        	       	{
  104
+			                        	       		Index = x.Index,
  105
+			                        	       		InProcessOfMovingToEndpoint = null,
  106
+			                        	       		AssignedEndpoint = endpoint,
  107
+			                        	       		PendingBackups = x.PendingBackups
  108
+			                        	       			.Where(e => e != endpoint)
  109
+			                        	       			.ToSet(),
  110
+			                        	       		Backups = x.Backups
  111
+			                        	       			.Append(endpoint)
  112
+			                        	       			.ToSet()
  113
+			                        	       	}).ToArray()
  114
+				);
81 115
 
  116
+		}
  117
+
  118
+		private void CaughtUpOnOwnership(IEnumerable<MatchSegment> modifiedSegments,
  119
+										 NodeEndpoint endpoint)
  120
+		{
82 121
 			Topology = new Topology((
83 122
 										from modifiedSegment in modifiedSegments
84  
-										let x = modifiedSegment.maybeMatchingSegment.FirstOrDefault()
  123
+										let x = modifiedSegment.Matching.FirstOrDefault()
85 124
 										select x == null
86  
-												? modifiedSegment.range
  125
+												? modifiedSegment.Segment
87 126
 												: new Segment
88 127
 												{
89 128
 													Index = x.Index,
@@ -95,17 +134,20 @@ public Segment[] Join(NodeEndpoint endpoint)
95 134
 														.ToSet()
96 135
 												}).ToArray()
97 136
 				);
98  
-			RearrangeBackups();
  137
+			RearsegmentBackups();
99 138
 		}
100 139
 
101 140
 		public void GaveUp(NodeEndpoint endpoint,
102 141
 						   ReplicationType type,
103  
-						   params int[] rangesGivingUpOn)
  142
+						   params int[] segmentsGivingUpOn)
104 143
 		{
105  
-			var matchingSegments = GetMatchingSegments(rangesGivingUpOn, endpoint);
106  
-			foreach (var range in matchingSegments)
  144
+			var matchingSegments = GetMatchingSegments(segmentsGivingUpOn, endpoint);
  145
+			foreach (var segment in matchingSegments)
107 146
 			{
108  
-				range.InProcessOfMovingToEndpoint = null;
  147
+				if (type == ReplicationType.Ownership)
  148
+					segment.InProcessOfMovingToEndpoint = null;
  149
+				else
  150
+					segment.PendingBackups.Remove(endpoint);
109 151
 			}
110 152
 		}
111 153
 
@@ -121,11 +163,11 @@ private static IEnumerable<Segment> CreateDefaultSegments()
121 163
 		{
122 164
 			for (var i = 0; i < 8192; i++)
123 165
 			{
124  
-				var range = new Segment
  166
+				var segment = new Segment
125 167
 				{
126 168
 					Index = i
127 169
 				};
128  
-				yield return range;
  170
+				yield return segment;
129 171
 			}
130 172
 		}
131 173
 
@@ -193,27 +235,28 @@ private void LogCurrentSegmentAssignment()
193 235
 			log.Debug(sb.ToString());
194 236
 		}
195 237
 
196  
-		private Segment[] GetMatchingSegments(IEnumerable<int> ranges,
  238
+		private Segment[] GetMatchingSegments(IEnumerable<int> segments,
197 239
 											  NodeEndpoint endpoint)
198 240
 		{
199  
-			var matchingSegments = ranges.Select(i => Segments[i]).ToArray();
  241
+			var matchingSegments = segments.Select(i => Segments[i]).ToArray();
200 242
 
201  
-			var rangesNotBeloningToThespecifiedEndpoint = matchingSegments
  243
+			var segmentsNotBeloningToThespecifiedEndpoint = matchingSegments
202 244
 				.Where(x => x.InProcessOfMovingToEndpoint != null)
203  
-				.Where(x => endpoint.Equals(x.InProcessOfMovingToEndpoint) == false);
  245
+				.Where(x => endpoint.Equals(x.InProcessOfMovingToEndpoint) == false &&
  246
+				            x.PendingBackups.Contains(endpoint) == false);
204 247
 
205  
-			if (rangesNotBeloningToThespecifiedEndpoint.Count() != 0)
206  
-				throw new InvalidOperationException("Could not catch up or give up on ranges that belong to another endpoint");
  248
+			if (segmentsNotBeloningToThespecifiedEndpoint.Count() != 0)
  249
+				throw new InvalidOperationException("Could not catch up or give up on segments that belong to another endpoint");
207 250
 			return matchingSegments;
208 251
 		}
209 252
 
210  
-		private void RearrangeBackups()
  253
+		private void RearsegmentBackups()
211 254
 		{
212  
-			var rearranger = new RearrangeBackups(Segments, endpoints, NumberOfBackCopiesToKeep);
213  
-			var rearranged = rearranger.Rearranging();
214  
-			if (rearranged == false)
  255
+			var rearsegmentr = new RearsegmentBackups(Segments, endpoints, NumberOfBackCopiesToKeep);
  256
+			var rearsegmentd = rearsegmentr.Rearranging();
  257
+			if (rearsegmentd == false)
215 258
 				return;
216  
-			foreach (var backUpAdded in rearranger.Changed)
  259
+			foreach (var backUpAdded in rearsegmentr.Changed)
217 260
 			{
218 261
 				BackupChanged(BackupState.Added, backUpAdded.Endpoint, backUpAdded.Segment);
219 262
 			}
@@ -229,17 +272,17 @@ private Segment[] JoinInternal(NodeEndpoint endpoint)
229 272
 				return Segments.Where(x => x.BelongsTo(endpoint)).ToArray();
230 273
 			}
231 274
 
232  
-			var rangesThatHadNoOwner = Segments
  275
+			var segmentsThatHadNoOwner = Segments
233 276
 				.Where(x => x.AssignedEndpoint == null)
234 277
 				.Apply(x => x.AssignedEndpoint = endpoint)
235 278
 				.ToArray();
236  
-			if (rangesThatHadNoOwner.Length > 0)
  279
+			if (segmentsThatHadNoOwner.Length > 0)
237 280
 			{
238  
-				log.DebugFormat("Endpoint {0} was assigned all ranges without owners", endpoint.Sync);
239  
-				return rangesThatHadNoOwner;
  281
+				log.DebugFormat("Endpoint {0} was assigned all segments without owners", endpoint.Sync);
  282
+				return segmentsThatHadNoOwner;
240 283
 			}
241 284
 
242  
-			log.DebugFormat("New endpoint {0}, allocating ranges for it", endpoint.Sync);
  285
+			log.DebugFormat("New endpoint {0}, allocating segments for it", endpoint.Sync);
243 286
 
244 287
 			return RestructureSegmentsFairly(endpoint);
245 288
 		}
@@ -248,28 +291,28 @@ private Segment[] RestructureSegmentsFairly(NodeEndpoint point)
248 291
 		{
249 292
 			var newSegments = new List<Segment>();
250 293
 			var index = 0;
251  
-			foreach (var range in Segments)
  294
+			foreach (var segment in Segments)
252 295
 			{
253 296
 				index += 1;
254 297
 
255  
-				if (range.InProcessOfMovingToEndpoint != null)
  298
+				if (segment.InProcessOfMovingToEndpoint != null)
256 299
 				{
257  
-					newSegments.Add(range);
  300
+					newSegments.Add(segment);
258 301
 					continue;
259 302
 				}
260 303
 				if (index % endpoints.Count == 0)
261 304
 				{
262 305
 					newSegments.Add(new Segment
263 306
 					{
264  
-						AssignedEndpoint = range.AssignedEndpoint,
  307
+						AssignedEndpoint = segment.AssignedEndpoint,
265 308
 						InProcessOfMovingToEndpoint = point,
266  
-						Index = range.Index,
267  
-						PendingBackups = range.PendingBackups
  309
+						Index = segment.Index,
  310
+						PendingBackups = segment.PendingBackups
268 311
 					});
269 312
 				}
270 313
 				else
271 314
 				{
272  
-					newSegments.Add(range);
  315
+					newSegments.Add(segment);
273 316
 				}
274 317
 			}
275 318
 			// this does NOT create a new topology version
20  Rhino.DistributedHashTable/Internal/DistributedHashTableNode.cs
@@ -54,15 +54,15 @@ public Guid GetTopologyVersion()
54 54
 			return Topology.Version;
55 55
 		}
56 56
 
57  
-		public bool IsSegmentOwned(int range)
  57
+		public bool IsSegmentOwned(int segment)
58 58
 		{
59  
-			return Topology.IsOwnedBy(endpoint, range);
  59
+			return Topology.IsOwnedBy(endpoint, segment);
60 60
 		}
61 61
 
62  
-		public void SendToOwner(int range,
  62
+		public void SendToOwner(int segment,
63 63
 								IExtendedRequest[] requests)
64 64
 		{
65  
-			var ownerSegment = Topology.GetSegment(range);
  65
+			var ownerSegment = Topology.GetSegment(segment);
66 66
 			if (ownerSegment.AssignedEndpoint == null)
67 67
 				return;
68 68
 			queueManager.Send(ownerSegment.AssignedEndpoint.Async,
@@ -72,10 +72,10 @@ public bool IsSegmentOwned(int range)
72 72
 							  });
73 73
 		}
74 74
 
75  
-		public void SendToAllOtherBackups(int range,
  75
+		public void SendToAllOtherBackups(int segment,
76 76
 										  IExtendedRequest[] requests)
77 77
 		{
78  
-			var ownerSegment = Topology.GetSegment(range);
  78
+			var ownerSegment = Topology.GetSegment(segment);
79 79
 			foreach (var otherBackup in ownerSegment.PendingBackups
80 80
 				.Append(ownerSegment.AssignedEndpoint)
81 81
 				.Where(x => x != endpoint))
@@ -96,9 +96,9 @@ public void DoneReplicatingSegments(ReplicationType type, int[] replicatedSegmen
96 96
 			State = NodeState.Started;
97 97
 		}
98 98
 
99  
-		public void GivingUpOn(ReplicationType type, params int[] rangesGivingUpOn)
  99
+		public void GivingUpOn(ReplicationType type, params int[] segmentsGivingUpOn)
100 100
 		{
101  
-			master.GaveUp(endpoint, type, rangesGivingUpOn);
  101
+			master.GaveUp(endpoint, type, segmentsGivingUpOn);
102 102
 		}
103 103
 
104 104
 		public IDistributedHashTableStorage Storage { get; set; }
@@ -107,10 +107,10 @@ public void Start()
107 107
 		{
108 108
 			var assignedSegments = master.Join(endpoint);
109 109
 			Topology = master.GetTopology();
110  
-			var rangesThatWeAreCatchingUpOnOwnership = assignedSegments
  110
+			var segmentsThatWeAreCatchingUpOnOwnership = assignedSegments
111 111
 				.Where(x => x.AssignedEndpoint != endpoint)
112 112
 				.ToArray();
113  
-			foreach (var segmentToReplicate in rangesThatWeAreCatchingUpOnOwnership
  113
+			foreach (var segmentToReplicate in segmentsThatWeAreCatchingUpOnOwnership
114 114
 				.GroupBy(x => x.AssignedEndpoint))
115 115
 			{
116 116
 				executer.RegisterForExecution(
10  Rhino.DistributedHashTable/Internal/IDistributedHashTableMaster.cs
@@ -4,8 +4,8 @@ public interface IDistributedHashTableMaster
4 4
 	{
5 5
 		/// <summary>
6 6
 		/// This method is called when a new node wants to join the cluster.
7  
-		/// The result is the ranges that this node is responsible for, if it is an
8  
-		/// existing one, or the list of ranges that it needs to pull from the currently 
  7
+		/// The result is the segments that this node is responsible for, if it is an
  8
+		/// existing one, or the list of segments that it needs to pull from the currently 
9 9
 		/// assigned node.
10 10
 		/// Note:
11 11
 		/// that if it needs to pull date from the currently assigned node, it will
@@ -15,18 +15,18 @@ public interface IDistributedHashTableMaster
15 15
 		Segment[] Join(NodeEndpoint endpoint);
16 16
 
17 17
 		/// <summary>
18  
-		/// Notify the master that the endpoint has caught up on all the specified ranges
  18
+		/// Notify the master that the endpoint has caught up on all the specified segments
19 19
 		/// </summary>
20 20
 		void CaughtUp(NodeEndpoint endpoint, ReplicationType type, params int[] caughtUpSegments);
21 21
 
22 22
 		Topology GetTopology();
23 23
 
24 24
 		/// <summary>
25  
-		/// Notify the master that the endpoint will not replicate this range
  25
+		/// Notify the master that the endpoint will not replicate this segment
26 26
 		/// </summary>
27 27
 		void GaveUp(NodeEndpoint endpoint,
28 28
 		            ReplicationType type,
29  
-		            params int[] rangesGivingUpOn);
  29
+		            params int[] segmentsGivingUpOn);
30 30
 
31 31
 
32 32
 	}
10  Rhino.DistributedHashTable/Internal/IDistributedHashTableNode.cs
@@ -9,20 +9,20 @@ public interface IDistributedHashTableNode : IDisposable
9 9
 
10 10
 		Guid GetTopologyVersion();
11 11
 
12  
-		bool IsSegmentOwned(int range);
  12
+		bool IsSegmentOwned(int segment);
13 13
 
14  
-		void SendToOwner(int range,
  14
+		void SendToOwner(int segment,
15 15
 						 params IExtendedRequest[] requests);
16 16
 
17  
-		void SendToAllOtherBackups(int range,
  17
+		void SendToAllOtherBackups(int segment,
18 18
 								   params IExtendedRequest[] requests);
19 19
 
20  
-		void DoneReplicatingSegments(ReplicationType type, params int[] ranges);
  20
+		void DoneReplicatingSegments(ReplicationType type, params int[] segments);
21 21
 
22 22
 
23 23
 		IDistributedHashTableStorage Storage { get; set; }
24 24
 		NodeEndpoint Endpoint { get; }
25  
-		void GivingUpOn(ReplicationType type, params int[] rangesGivingUpOn);
  25
+		void GivingUpOn(ReplicationType type, params int[] segmentsGivingUpOn);
26 26
 		void Start();
27 27
 	}
28 28
 }
16  Rhino.DistributedHashTable/Internal/Topology.cs
@@ -16,27 +16,27 @@ public Topology()
16 16
 		{
17 17
 		}
18 18
 
19  
-		public Topology(Segment[] ranges, Guid version)
  19
+		public Topology(Segment[] segments, Guid version)
20 20
 		{
21  
-			Segments = ranges;
  21
+			Segments = segments;
22 22
 			Version = version;
23 23
 			Timestamp = DateTime.Now;
24 24
 		}
25 25
 
26  
-		public Topology(Segment[] ranges)
27  
-			: this(ranges, Guid.NewGuid())
  26
+		public Topology(Segment[] segments)
  27
+			: this(segments, Guid.NewGuid())
28 28
 		{
29 29
 		}
30 30
 
31 31
 		public bool IsOwnedBy(NodeEndpoint endpoint,
32  
-		                      int range)
  32
+		                      int segment)
33 33
 		{
34  
-			return GetSegment(range).AssignedEndpoint == endpoint;
  34
+			return GetSegment(segment).AssignedEndpoint == endpoint;
35 35
 		}
36 36
 
37  
-		public Segment GetSegment(int range)
  37
+		public Segment GetSegment(int segment)
38 38
 		{
39  
-			return Segments[range];
  39
+			return Segments[segment];
40 40
 		}
41 41
 	}
42 42
 }
20  Rhino.DistributedHashTable/Remote/DistributedHashTableNodeReplication.cs
@@ -17,14 +17,14 @@ public DistributedHashTableNodeReplication(PersistentHashTable.PersistentHashTab
17 17
 		}
18 18
 
19 19
 		public ReplicationResult ReplicateNextPage(NodeEndpoint replicationEndpoint,
20  
-												   int range)
  20
+												   int segment)
21 21
 		{
22 22
 			var putRequests = new List<ExtendedPutRequest>();
23 23
 			var removalRequests = new List<ExtendedRemoveRequest>();
24 24
 			bool done = false;
25 25
 			hashTable.Batch(actions =>
26 26
 			{
27  
-				foreach (var getRequest in actions.GetKeysForTag(range))
  27
+				foreach (var getRequest in actions.GetKeysForTag(segment))
28 28
 				{
29 29
 					var alreadyReplicated = actions.HasReplicationInfo(getRequest.Key,
30 30
 														  getRequest.SpecifiedVersion,
@@ -73,7 +73,7 @@ public DistributedHashTableNodeReplication(PersistentHashTable.PersistentHashTab
73 73
 				done = putRequests.Count == 0 && removalRequests.Count == 0;
74 74
 				if (done)
75 75
 				{
76  
-					MarkSegmentAsAssignedToEndpoint(actions, replicationEndpoint, range);
  76
+					MarkSegmentAsAssignedToEndpoint(actions, replicationEndpoint, segment);
77 77
 				}
78 78
 
79 79
 				actions.Commit();
@@ -88,19 +88,19 @@ public DistributedHashTableNodeReplication(PersistentHashTable.PersistentHashTab
88 88
 		}
89 89
 
90 90
 		public int[] AssignAllEmptySegments(NodeEndpoint replicationEndpoint,
91  
-										   int[] ranges)
  91
+										   int[] segments)
92 92
 		{
93 93
 			var reservedSegments = new List<int>();
94 94
 
95 95
 			hashTable.Batch(actions =>
96 96
 			{
97  
-				foreach (var range in ranges)
  97
+				foreach (var segment in segments)
98 98
 				{
99  
-					if (actions.HasTag((int)range))
  99
+					if (actions.HasTag((int)segment))
100 100
 						continue;
101  
-					if (MarkSegmentAsAssignedToEndpoint(actions, replicationEndpoint, range) == false)
  101
+					if (MarkSegmentAsAssignedToEndpoint(actions, replicationEndpoint, segment) == false)
102 102
 						continue;
103  
-					reservedSegments.Add(range);
  103
+					reservedSegments.Add(segment);
104 104
 				}
105 105
 				actions.Commit();
106 106
 			});
@@ -110,11 +110,11 @@ public DistributedHashTableNodeReplication(PersistentHashTable.PersistentHashTab
110 110
 
111 111
 		private static bool MarkSegmentAsAssignedToEndpoint(PersistentHashTableActions actions,
112 112
 												   NodeEndpoint endpoint,
113  
-												   int range)
  113
+												   int segment)
114 114
 		{
115 115
 			var result = actions.Put(new PutRequest
116 116
 			{
117  
-				Key = Constants.MovedSegment + range,
  117
+				Key = Constants.MovedSegment + segment,
118 118
 				OptimisticConcurrency = true,
119 119
 				Bytes = endpoint.ToBytes(),
120 120
 			});
16  Rhino.DistributedHashTable/Remote/IDistributedHashTableNodeReplication.cs
@@ -9,20 +9,20 @@ public interface IDistributedHashTableNodeReplication
9 9
 		/// retreive a page of put requests for online replication
10 10
 		/// will mark each returned result with the replication endpoint so it will know
11 11
 		/// whatever values has been changed (changing the value remove the replication version)
12  
-		/// If there are no more results, the range is assigned to the endpoint
  12
+		/// If there are no more results, the segment is assigned to the endpoint
13 13
 		/// </summary>
14  
-		ReplicationResult ReplicateNextPage(NodeEndpoint replicationEndpoint, int range);
  14
+		ReplicationResult ReplicateNextPage(NodeEndpoint replicationEndpoint, int segment);
15 15
 
16 16
 
17 17
 		/// <summary>
18  
-		/// This method assign all the empty ranges in the specified list to the 
19  
-		/// specified endpoint, returning all the ranges that
  18
+		/// This method assign all the empty segments in the specified list to the 
  19
+		/// specified endpoint, returning all the segments that
20 20
 		/// had no elements in them.
21  
-		/// The idea it to speed up range assignment by first getting rid of 
22  
-		/// all the empty ranges.
23  
-		/// After this methods return, any call to a node with a range that was 
  21
+		/// The idea it to speed up segment assignment by first getting rid of 
  22
+		/// all the empty segments.
  23
+		/// After this methods return, any call to a node with a segment that was 
24 24
 		/// returned from this method will raise a <seealso cref="SeeOtherException"/>
25 25
 		/// </summary>
26  
-		int[] AssignAllEmptySegments(NodeEndpoint replicationEndpoint, int[] ranges);
  26
+		int[] AssignAllEmptySegments(NodeEndpoint replicationEndpoint, int[] segments);
27 27
 	}
28 28
 }
6  Rhino.DistributedHashTable/Todo.txt
@@ -5,11 +5,11 @@
5 5
 
6 6
 * Fairness monitor:
7 7
 	* distribute the backup responsability to all nodes
8  
-	* distribute ranges fairly across all nodes
  8
+	* distribute segments fairly across all nodes
9 9
 	
10 10
 * Is Alive monitor
11  
-	* Clear assignments to take over a range
  11
+	* Clear assignments to take over a segment
12 12
 	* Detect if node is down for extended period of time
13 13
 	
14  
-* When topology change see if replication failure for assigning range will remove the SeeOther restriction
  14
+* When topology change see if replication failure for assigning segment will remove the SeeOther restriction
15 15
 * MasterSelectionStrategy (low priority)

0 notes on commit a7269f6

Please sign in to comment.
Something went wrong with that request. Please try again.