@@ -47,22 +47,22 @@ func (c *Cluster) DistributedTransactions(bcp Backuper, col string) {
47
47
48
48
c .setupTrxCollection (ctx , col )
49
49
50
- c .moveChunk (ctx , col , 0 , "rs1" )
51
- c .moveChunk (ctx , col , 30 , "rs1" )
52
- c .moveChunk (ctx , col , 89 , "rs1" )
53
- c .moveChunk (ctx , col , 99 , "rs1" )
54
- c .moveChunk (ctx , col , 110 , "rs1" )
55
- c .moveChunk (ctx , col , 130 , "rs1" )
56
- c .moveChunk (ctx , col , 131 , "rs1" )
57
- c .moveChunk (ctx , col , 630 , "rsx" )
58
- c .moveChunk (ctx , col , 530 , "rsx" )
59
- c .moveChunk (ctx , col , 631 , "rsx" )
60
- c .moveChunk (ctx , col , 730 , "rsx" )
61
- c .moveChunk (ctx , col , 3000 , "rsx" )
62
- c .moveChunk (ctx , col , 3001 , "rsx" )
63
- c .moveChunk (ctx , col , 180 , "rsx" )
64
- c .moveChunk (ctx , col , 199 , "rsx" )
65
- c .moveChunk (ctx , col , 2001 , "rsx" )
50
+ c .moveChunk (ctx , trxdb , col , 0 , "rs1" )
51
+ c .moveChunk (ctx , trxdb , col , 30 , "rs1" )
52
+ c .moveChunk (ctx , trxdb , col , 89 , "rs1" )
53
+ c .moveChunk (ctx , trxdb , col , 99 , "rs1" )
54
+ c .moveChunk (ctx , trxdb , col , 110 , "rs1" )
55
+ c .moveChunk (ctx , trxdb , col , 130 , "rs1" )
56
+ c .moveChunk (ctx , trxdb , col , 131 , "rs1" )
57
+ c .moveChunk (ctx , trxdb , col , 630 , "rsx" )
58
+ c .moveChunk (ctx , trxdb , col , 530 , "rsx" )
59
+ c .moveChunk (ctx , trxdb , col , 631 , "rsx" )
60
+ c .moveChunk (ctx , trxdb , col , 730 , "rsx" )
61
+ c .moveChunk (ctx , trxdb , col , 3000 , "rsx" )
62
+ c .moveChunk (ctx , trxdb , col , 3001 , "rsx" )
63
+ c .moveChunk (ctx , trxdb , col , 180 , "rsx" )
64
+ c .moveChunk (ctx , trxdb , col , 199 , "rsx" )
65
+ c .moveChunk (ctx , trxdb , col , 2001 , "rsx" )
66
66
67
67
_ , err = conn .Database (trxdb ).Collection (col ).DeleteMany (ctx , bson.M {})
68
68
if err != nil {
@@ -322,21 +322,6 @@ func (c *Cluster) setupTrxCollection(ctx context.Context, col string) {
322
322
}
323
323
}
324
324
325
- func (c * Cluster ) moveChunk (ctx context.Context , col string , idx int , to string ) {
326
- log .Println ("move chunk" , idx , "to" , to )
327
- err := c .mongos .Conn ().Database ("admin" ).RunCommand (
328
- ctx ,
329
- bson.D {
330
- {"moveChunk" , trxdb + "." + col },
331
- {"find" , bson.M {"idx" : idx }},
332
- {"to" , to },
333
- },
334
- ).Err ()
335
- if err != nil {
336
- log .Printf ("ERROR: moveChunk %s.%s/idx:2000: %v" , trxdb , col , err )
337
- }
338
- }
339
-
340
325
func (c * Cluster ) checkTrxCollection (ctx context.Context , col string , bcp Backuper ) {
341
326
log .Println ("Checking restored data" )
342
327
0 commit comments