@@ -19,7 +19,7 @@ Y_UNIT_TEST(Block42Success) {
19
19
SetupRuntime (runtime);
20
20
TDSProxyEnv env;
21
21
env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
22
- TTestState testState (runtime, type, env.Info );
22
+ TTestState testState (runtime, env.Info );
23
23
24
24
const ui64 tabletId = 72075186224047637 ;
25
25
TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
@@ -37,6 +37,7 @@ Y_UNIT_TEST(Block42Success) {
37
37
testState.HandleVGetsWithMock (8 ); // get the blob
38
38
39
39
TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
40
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::OK);
40
41
UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Id , blobId2);
41
42
}
42
43
@@ -46,15 +47,14 @@ Y_UNIT_TEST(Block42SuccessLastBlobMissingParts) {
46
47
SetupRuntime (runtime);
47
48
TDSProxyEnv env;
48
49
env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
49
- TTestState testState (runtime, type, env.Info );
50
+ TTestState testState (runtime, env.Info );
50
51
51
52
const ui64 tabletId = 72075186224047637 ;
52
53
TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
53
54
TLogoBlobID blobId2 (tabletId, 1 , 2 , 0 , testState.BlobSize , 0 );
54
55
55
56
TGroupMock& groupMock = testState.GetGroupMock ();
56
57
groupMock.Put (blobId1, testState.BlobData );
57
- // FIXIT: if parts are 1 2 3 4 then 5 and 6 part are restored twice
58
58
THashSet<ui32> selectedParts{3 , 4 , 5 , 6 };
59
59
groupMock.Put (blobId2, testState.BlobData , 0 , &selectedParts);
60
60
@@ -67,6 +67,7 @@ Y_UNIT_TEST(Block42SuccessLastBlobMissingParts) {
67
67
testState.HandleVPutsWithMock (2 ); // restore puts
68
68
69
69
TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
70
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::OK);
70
71
UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Id , blobId2);
71
72
}
72
73
@@ -76,7 +77,7 @@ Y_UNIT_TEST(Block42SuccessLastBlobNotFullyWritten) {
76
77
SetupRuntime (runtime);
77
78
TDSProxyEnv env;
78
79
env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
79
- TTestState testState (runtime, type, env.Info );
80
+ TTestState testState (runtime, env.Info );
80
81
81
82
const ui64 tabletId = 72075186224047637 ;
82
83
TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
@@ -95,18 +96,17 @@ Y_UNIT_TEST(Block42SuccessLastBlobNotFullyWritten) {
95
96
testState.HandleVGetsWithMock (8 );
96
97
97
98
TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
99
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::OK);
98
100
UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Id , blobId1);
99
101
}
100
102
101
- // FIXIT: this test crashes in DSProxy
102
- /*
103
- Y_UNIT_TEST(Block42ProxyCrashWhileGettingTheBlob) {
103
+ Y_UNIT_TEST (Block42ErrorWhenBlobIsLostAfterDiscover) {
104
104
TBlobStorageGroupType type (TErasureType::Erasure4Plus2Block);
105
105
TTestBasicRuntime runtime;
106
106
SetupRuntime (runtime);
107
107
TDSProxyEnv env;
108
108
env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
109
- TTestState testState(runtime, type, env.Info);
109
+ TTestState testState (runtime, env.Info );
110
110
111
111
const ui64 tabletId = 72075186224047637 ;
112
112
TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
@@ -126,9 +126,97 @@ Y_UNIT_TEST(Block42ProxyCrashWhileGettingTheBlob) {
126
126
testState.HandleVGetsWithMock (8 );
127
127
128
128
TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
129
- UNIT_ASSERT_VALUES_EQUAL(ev->Get()->Id, blobId1);
129
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::ERROR);
130
+ }
131
+
132
+ Y_UNIT_TEST (Mirror3dcSuccess) {
133
+ TBlobStorageGroupType type (TErasureType::ErasureMirror3dc);
134
+ TTestBasicRuntime runtime;
135
+ SetupRuntime (runtime);
136
+ TDSProxyEnv env;
137
+ env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
138
+ TTestState testState (runtime, env.Info );
139
+
140
+ const ui64 tabletId = 72075186224047637 ;
141
+ TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
142
+ TLogoBlobID blobId2 (tabletId, 1 , 2 , 0 , testState.BlobSize , 0 );
143
+
144
+ TGroupMock& groupMock = testState.GetGroupMock ();
145
+ groupMock.Put (blobId1, testState.BlobData );
146
+ groupMock.Put (blobId2, testState.BlobData );
147
+
148
+ auto discover = std::make_unique<TEvBlobStorage::TEvDiscover>(
149
+ tabletId, 1 , true , false , TInstant::Max (), 0 , true );
150
+ runtime.Send (new IEventHandle (env.RealProxyActorId , testState.EdgeActor , discover.release ()), 0 , true );
151
+
152
+ testState.HandleVGetsWithMock (9 );
153
+ testState.HandleVGetsWithMock (9 );
154
+ testState.HandleVPutsWithMock (1 );
155
+
156
+ TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
157
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::OK);
158
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Id , blobId2);
159
+ }
160
+
161
+ Y_UNIT_TEST (Mirror3dcSuccessLastBlobMissingParts) {
162
+ TBlobStorageGroupType type (TErasureType::ErasureMirror3dc);
163
+ TTestBasicRuntime runtime;
164
+ SetupRuntime (runtime);
165
+ TDSProxyEnv env;
166
+ env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
167
+ TTestState testState (runtime, env.Info );
168
+
169
+ const ui64 tabletId = 72075186224047637 ;
170
+ TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
171
+ TLogoBlobID blobId2 (tabletId, 1 , 2 , 0 , testState.BlobSize , 0 );
172
+
173
+ TGroupMock& groupMock = testState.GetGroupMock ();
174
+ groupMock.Put (blobId1, testState.BlobData );
175
+ THashSet<ui32> selectedParts{1 };
176
+ groupMock.Put (blobId2, testState.BlobData , 0 , &selectedParts);
177
+
178
+ auto discover = std::make_unique<TEvBlobStorage::TEvDiscover>(
179
+ tabletId, 1 , true , false , TInstant::Max (), 0 , true );
180
+ runtime.Send (new IEventHandle (env.RealProxyActorId , testState.EdgeActor , discover.release ()), 0 , true );
181
+
182
+ testState.HandleVGetsWithMock (9 );
183
+ testState.HandleVGetsWithMock (9 );
184
+ testState.HandleVPutsWithMock (3 );
185
+
186
+ TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
187
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::OK);
188
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Id , blobId2);
189
+ }
190
+
191
+ Y_UNIT_TEST (Mirror3dcErrorWhenBlobIsLostAfterDiscover) {
192
+ TBlobStorageGroupType type (TErasureType::ErasureMirror3dc);
193
+ TTestBasicRuntime runtime;
194
+ SetupRuntime (runtime);
195
+ TDSProxyEnv env;
196
+ env.Configure (runtime, type, 0 , 0 , TBlobStorageGroupInfo::EEM_NONE);
197
+ TTestState testState (runtime, env.Info );
198
+
199
+ const ui64 tabletId = 72075186224047637 ;
200
+ TLogoBlobID blobId1 (tabletId, 1 , 1 , 0 , testState.BlobSize , 0 );
201
+ TLogoBlobID blobId2 (tabletId, 1 , 2 , 0 , testState.BlobSize , 0 );
202
+
203
+ TGroupMock& groupMock = testState.GetGroupMock ();
204
+ groupMock.Put (blobId1, testState.BlobData );
205
+ groupMock.Put (blobId2, testState.BlobData );
206
+
207
+ auto discover = std::make_unique<TEvBlobStorage::TEvDiscover>(
208
+ tabletId, 1 , true , false , TInstant::Max (), 0 , true );
209
+ runtime.Send (new IEventHandle (env.RealProxyActorId , testState.EdgeActor , discover.release ()), 0 , true );
210
+
211
+ testState.HandleVGetsWithMock (9 );
212
+ testState.GroupMock .SetError (TVDiskID (0 , 1 , 0 , 0 , 0 ), NKikimrProto::ERROR);
213
+ testState.GroupMock .SetError (TVDiskID (0 , 1 , 1 , 0 , 0 ), NKikimrProto::NOT_YET);
214
+ testState.GroupMock .SetError (TVDiskID (0 , 1 , 2 , 0 , 0 ), NKikimrProto::NOT_YET);
215
+ testState.HandleVGetsWithMock (9 );
216
+
217
+ TEvBlobStorage::TEvDiscoverResult::TPtr ev = testState.GrabEventPtr <TEvBlobStorage::TEvDiscoverResult>();
218
+ UNIT_ASSERT_VALUES_EQUAL (ev->Get ()->Status , NKikimrProto::ERROR);
130
219
}
131
- */
132
220
133
221
} // TDSProxyDiscover
134
222
0 commit comments