|
1 |
| -#include "helpers/typed_local.h" |
2 | 1 | #include "helpers/local.h"
|
| 2 | +#include "helpers/typed_local.h" |
3 | 3 | #include "helpers/writer.h"
|
4 |
| -#include <ydb/core/tx/columnshard/data_sharing/initiator/controller/abstract.h> |
5 |
| -#include <ydb/core/tx/columnshard/hooks/testing/controller.h> |
| 4 | + |
| 5 | +#include <ydb/core/base/tablet_pipecache.h> |
6 | 6 | #include <ydb/core/tx/columnshard/common/snapshot.h>
|
7 |
| -#include <ydb/core/tx/columnshard/data_sharing/initiator/status/abstract.h> |
8 | 7 | #include <ydb/core/tx/columnshard/data_sharing/common/context/context.h>
|
9 |
| -#include <ydb/core/tx/columnshard/data_sharing/destination/session/destination.h> |
10 | 8 | #include <ydb/core/tx/columnshard/data_sharing/destination/events/control.h>
|
11 |
| -#include <ydb/core/base/tablet_pipecache.h> |
| 9 | +#include <ydb/core/tx/columnshard/data_sharing/destination/session/destination.h> |
| 10 | +#include <ydb/core/tx/columnshard/data_sharing/initiator/controller/abstract.h> |
| 11 | +#include <ydb/core/tx/columnshard/data_sharing/initiator/status/abstract.h> |
| 12 | +#include <ydb/core/tx/columnshard/hooks/testing/controller.h> |
| 13 | + |
12 | 14 | #include <ydb/public/sdk/cpp/client/ydb_operation/operation.h>
|
13 | 15 | #include <ydb/public/sdk/cpp/client/ydb_ss_tasks/task.h>
|
14 | 16 |
|
@@ -276,7 +278,7 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
|
276 | 278 | void WaitResharding(const TString& hint = "") {
|
277 | 279 | const TInstant start = TInstant::Now();
|
278 | 280 | bool clean = false;
|
279 |
| - while (TInstant::Now() - start < TDuration::Seconds(20)) { |
| 281 | + while (TInstant::Now() - start < TDuration::Seconds(200)) { |
280 | 282 | NYdb::NOperation::TOperationClient operationClient(Kikimr.GetDriver());
|
281 | 283 | auto result = operationClient.List<NYdb::NSchemeShard::TBackgroundProcessesResponse>().GetValueSync();
|
282 | 284 | UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), NYdb::EStatus::SUCCESS, result.GetIssues().ToString());
|
@@ -408,7 +410,7 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
|
408 | 410 |
|
409 | 411 | public:
|
410 | 412 | TAsyncReshardingTest() {
|
411 |
| - TLocalHelper(Kikimr).CreateTestOlapTable("olapTable", "olapStore", 128, 4); |
| 413 | + TLocalHelper(Kikimr).CreateTestOlapTable("olapTable", "olapStore", 1024, 32); |
412 | 414 | }
|
413 | 415 |
|
414 | 416 | void AddBatch(int numRows) {
|
@@ -561,5 +563,120 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) {
|
561 | 563 |
|
562 | 564 | tester.CheckCount();
|
563 | 565 | }
|
| 566 | + |
| 567 | + Y_UNIT_TEST(MultipleMerge) { |
| 568 | + TAsyncReshardingTest tester; |
| 569 | + tester.DisableCompaction(); |
| 570 | + |
| 571 | + tester.AddBatch(10000); |
| 572 | + |
| 573 | + for (int i = 0; i < 4; i++) { |
| 574 | + tester.StartResharding("MERGE"); |
| 575 | + tester.WaitResharding(); |
| 576 | + } |
| 577 | + |
| 578 | + tester.RestartAllShards(); |
| 579 | + |
| 580 | + tester.CheckCount(); |
| 581 | + } |
| 582 | + |
| 583 | + Y_UNIT_TEST(MultipleSplits) { |
| 584 | + TAsyncReshardingTest tester; |
| 585 | + tester.DisableCompaction(); |
| 586 | + |
| 587 | + tester.AddBatch(10000); |
| 588 | + |
| 589 | + for (int i = 0; i < 4; i++) { |
| 590 | + tester.StartResharding("SPLIT"); |
| 591 | + tester.WaitResharding(); |
| 592 | + } |
| 593 | + |
| 594 | + tester.RestartAllShards(); |
| 595 | + |
| 596 | + tester.CheckCount(); |
| 597 | + } |
| 598 | + |
| 599 | + Y_UNIT_TEST(MultipleSplitsThenMerges) { |
| 600 | + TAsyncReshardingTest tester; |
| 601 | + tester.DisableCompaction(); |
| 602 | + |
| 603 | + tester.AddBatch(10000); |
| 604 | + |
| 605 | + for (int i = 0; i < 4; i++) { |
| 606 | + tester.StartResharding("SPLIT"); |
| 607 | + tester.WaitResharding(); |
| 608 | + } |
| 609 | + |
| 610 | + for (int i = 0; i < 8; i++) { |
| 611 | + tester.StartResharding("MERGE"); |
| 612 | + tester.WaitResharding(); |
| 613 | + } |
| 614 | + |
| 615 | + tester.RestartAllShards(); |
| 616 | + |
| 617 | + tester.CheckCount(); |
| 618 | + } |
| 619 | + |
| 620 | + Y_UNIT_TEST(MultipleSplitsWithRestartsAfterWait) { |
| 621 | + TAsyncReshardingTest tester; |
| 622 | + tester.DisableCompaction(); |
| 623 | + |
| 624 | + tester.AddBatch(10000); |
| 625 | + |
| 626 | + for (int i = 0; i < 4; i++) { |
| 627 | + tester.StartResharding("SPLIT"); |
| 628 | + tester.WaitResharding(); |
| 629 | + tester.RestartAllShards(); |
| 630 | + } |
| 631 | + |
| 632 | + tester.CheckCount(); |
| 633 | + } |
| 634 | + |
| 635 | + Y_UNIT_TEST(MultipleSplitsWithRestartsWhenWait) { |
| 636 | + TAsyncReshardingTest tester; |
| 637 | + tester.DisableCompaction(); |
| 638 | + |
| 639 | + tester.AddBatch(10000); |
| 640 | + |
| 641 | + for (int i = 0; i < 4; i++) { |
| 642 | + tester.StartResharding("SPLIT"); |
| 643 | + tester.RestartAllShards(); |
| 644 | + tester.WaitResharding(); |
| 645 | + } |
| 646 | + tester.RestartAllShards(); |
| 647 | + |
| 648 | + tester.CheckCount(); |
| 649 | + } |
| 650 | + |
| 651 | + Y_UNIT_TEST(MultipleMergesWithRestartsAfterWait) { |
| 652 | + TAsyncReshardingTest tester; |
| 653 | + tester.DisableCompaction(); |
| 654 | + |
| 655 | + tester.AddBatch(10000); |
| 656 | + |
| 657 | + for (int i = 0; i < 4; i++) { |
| 658 | + tester.StartResharding("MERGE"); |
| 659 | + tester.WaitResharding(); |
| 660 | + tester.RestartAllShards(); |
| 661 | + } |
| 662 | + |
| 663 | + tester.CheckCount(); |
| 664 | + } |
| 665 | + |
| 666 | + Y_UNIT_TEST(MultipleMergesWithRestartsWhenWait) { |
| 667 | + TAsyncReshardingTest tester; |
| 668 | + tester.DisableCompaction(); |
| 669 | + |
| 670 | + tester.AddBatch(10000); |
| 671 | + |
| 672 | + for (int i = 0; i < 4; i++) { |
| 673 | + tester.StartResharding("MERGE"); |
| 674 | + tester.RestartAllShards(); |
| 675 | + tester.WaitResharding(); |
| 676 | + } |
| 677 | + tester.RestartAllShards(); |
| 678 | + |
| 679 | + tester.CheckCount(); |
| 680 | + } |
564 | 681 | }
|
565 | 682 | }
|
0 commit comments