Skip to content

Commit

Permalink
Switch different Reshard traffic back and forth
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Oct 18, 2024
1 parent 11b46f8 commit c32c7e0
Showing 1 changed file with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,11 @@ func splitShard(t *testing.T, keyspace, workflowName, sourceShards, targetShards
vdiff(t, keyspace, workflowName, "zone1", false, true, nil)

shardReadsRouteToSource := func() {
require.True(t, getShardRoute(t, keyspace, "-80", "primary"))
require.True(t, getShardRoute(t, keyspace, "-80", "replica"))
}

shardReadsRouteToTarget := func() {
require.True(t, getShardRoute(t, keyspace, "-40", "primary"))
require.True(t, getShardRoute(t, keyspace, "-40", "replica"))
}

shardWritesRouteToSource := func() {
Expand All @@ -486,27 +486,48 @@ func splitShard(t *testing.T, keyspace, workflowName, sourceShards, targetShards
shardWritesRouteToSource()

rs.SwitchReads()
shardReadsRouteToTarget()
shardWritesRouteToSource()

rs.ReverseReads()
shardReadsRouteToSource()
shardWritesRouteToSource()

rs.SwitchReadsAndWrites()
shardReadsRouteToTarget()
shardWritesRouteToTarget()

rs.ReverseReadsAndWrites()
shardReadsRouteToSource()
shardWritesRouteToSource()

rs.SwitchReadsAndWrites()
shardReadsRouteToTarget()
shardWritesRouteToTarget()

rs.ReverseReads()
shardReadsRouteToSource()
shardWritesRouteToTarget()

rs.ReverseWrites()
shardReadsRouteToSource()
shardWritesRouteToSource()

rs.SwitchReadsAndWrites()
shardReadsRouteToTarget()
shardWritesRouteToTarget()

rs.ReverseWrites()
shardReadsRouteToTarget()
shardWritesRouteToSource()

rs.ReverseReads()
shardReadsRouteToSource()
shardWritesRouteToSource()

rs.SwitchReadsAndWrites()
require.True(t, getShardRoute(t, keyspace, "-40", "primary"))
shardReadsRouteToTarget()
shardWritesRouteToTarget()

rs.Complete()
}
Expand Down

0 comments on commit c32c7e0

Please sign in to comment.