-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
protectedts
148 lines (126 loc) · 4.96 KB
/
protectedts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Test span configs in the presence of multiple secondary tenants, each running
# their own reconciliation loop.
reconcile
----
mutations discard
----
initialize tenant=10
----
# Ensure that the host tenant observes no mutations.
mutations
----
# We should observe placeholder entries for both tenants (installed when
# creating tenant records).
state offset=47
----
...
/Table/5{0-1} database system (host)
/Tenant/10{-"\x00"} database system (tenant)
# Write a protected timestamp record on the system tenant cluster.
protect record-id=1 ts=1
cluster
----
# Write a protected timestamp record on the system tenant keyspace, and on the
# secondary tenant keyspace.
protect record-id=2 ts=2
tenants 1,10
----
# Start the reconciliation loop for the secondary tenant.
reconcile tenant=10
----
# We should see protected timestamp record mutations as the host tenant.
mutations
----
upsert {entire-keyspace} pts=[1]
upsert {source=1,target=1} pts=[2]
upsert {source=1,target=10} pts=[2]
# We shouldn't see any protected timestamp record mutations as a secondary
# tenant.
mutations tenant=10
----
delete /Tenant/10{-"\x00"}
upsert /Tenant/10{-/Table/4} database system (tenant)
upsert /Tenant/10/Table/{4-5} database system (tenant)
upsert /Tenant/10/Table/{5-6} database system (tenant)
upsert /Tenant/10/Table/{6-7} database system (tenant)
upsert /Tenant/10/Table/{7-8} database system (tenant)
upsert /Tenant/10/Table/1{1-2} database system (tenant)
upsert /Tenant/10/Table/1{2-3} database system (tenant)
upsert /Tenant/10/Table/1{3-4} database system (tenant)
upsert /Tenant/10/Table/1{4-5} database system (tenant)
upsert /Tenant/10/Table/1{5-6} database system (tenant)
upsert /Tenant/10/Table/{19-20} database system (tenant)
upsert /Tenant/10/Table/2{0-1} database system (tenant)
upsert /Tenant/10/Table/2{1-2} database system (tenant)
upsert /Tenant/10/Table/2{3-4} database system (tenant)
upsert /Tenant/10/Table/2{4-5} database system (tenant)
upsert /Tenant/10/Table/2{5-6} database system (tenant)
upsert /Tenant/10/Table/2{6-7} database system (tenant)
upsert /Tenant/10/Table/2{7-8} database system (tenant)
upsert /Tenant/10/Table/2{8-9} database system (tenant)
upsert /Tenant/10/NamespaceTable/{30-Max} database system (tenant)
upsert /Tenant/10/{NamespaceTable/Max-Table/32} database system (tenant)
upsert /Tenant/10/Table/3{2-3} database system (tenant)
upsert /Tenant/10/Table/3{3-4} database system (tenant)
upsert /Tenant/10/Table/3{4-5} database system (tenant)
upsert /Tenant/10/Table/3{5-6} database system (tenant)
upsert /Tenant/10/Table/3{6-7} database system (tenant)
upsert /Tenant/10/Table/3{7-8} database system (tenant)
upsert /Tenant/10/Table/{39-40} database system (tenant)
upsert /Tenant/10/Table/4{0-1} database system (tenant)
upsert /Tenant/10/Table/4{1-2} database system (tenant)
upsert /Tenant/10/Table/4{2-3} database system (tenant)
upsert /Tenant/10/Table/4{3-4} database system (tenant)
upsert /Tenant/10/Table/4{4-5} database system (tenant)
upsert /Tenant/10/Table/4{6-7} database system (tenant)
exec-sql tenant=10
CREATE DATABASE db;
CREATE TABLE db.t1();
CREATE TABLE db.t2();
----
# Write a protected timestamp record on the cluster as a secondary tenant.
protect record-id=3 ts=3 cluster tenant=10
cluster
----
# We expect to see no mutations on the host tenant.
mutations
----
mutations tenant=10
----
upsert {source=10,target=10} pts=[3]
upsert /Tenant/10/Table/10{6-7} range default
upsert /Tenant/10/Table/10{7-8} range default
state limit=4
----
{entire-keyspace} pts=[1]
{source=1,target=1} pts=[2]
{source=1,target=10} pts=[2]
{source=10,target=10} pts=[3]
...
# Release all the protected timestamp records from the host tenant.
release record-id=1
----
release record-id=2
----
# We expect to see no mutations on the secondary tenant.
mutations tenant=10
----
mutations
----
delete {entire-keyspace}
delete {source=1,target=1}
delete {source=1,target=10}
# Release all the protected timestamp records from the secondary tenant.
release record-id=3 tenant=10
----
mutations tenant=10
----
delete {source=10,target=10}
# All system span config targets should have been removed at this point.
state limit=4
----
/{Min-System/NodeLiveness} ttl_seconds=3600 num_replicas=5
/System/NodeLiveness{-Max} ttl_seconds=600 num_replicas=5
/System/{NodeLivenessMax-tsd} range system
/System{/tsd-tse} range default
...