@@ -2568,6 +2568,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
2568
2568
2569
2569
}
2570
2570
2571
+
2571
2572
// clear subdomain
2572
2573
{
2573
2574
TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
@@ -2585,6 +2586,155 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
2585
2586
}
2586
2587
}
2587
2588
2589
+ Y_UNIT_TEST (ColumnSchemeLimitsRejects) {
2590
+ TTestBasicRuntime runtime;
2591
+ TTestEnv env (runtime);
2592
+ ui64 txId = 100 ;
2593
+
2594
+ TSchemeLimits lowLimits;
2595
+ lowLimits.MaxDepth = 4 ;
2596
+ lowLimits.MaxPaths = 3 ;
2597
+ lowLimits.MaxChildrenInDir = 3 ;
2598
+ lowLimits.MaxAclBytesSize = 25 ;
2599
+ lowLimits.MaxTableColumns = 3 ;
2600
+ lowLimits.MaxColumnTableColumns = 3 ;
2601
+ lowLimits.MaxTableColumnNameLength = 10 ;
2602
+ lowLimits.MaxTableKeyColumns = 1 ;
2603
+ lowLimits.MaxShards = 6 ;
2604
+ lowLimits.MaxShardsInPath = 4 ;
2605
+ lowLimits.MaxPQPartitions = 20 ;
2606
+
2607
+
2608
+ // lowLimits.ExtraPathSymbolsAllowed = "!\"#$%&'()*+,-.:;<=>?@[\\]^_`{|}~";
2609
+ SetSchemeshardSchemaLimits (runtime, lowLimits);
2610
+ TestDescribeResult (DescribePath (runtime, " /MyRoot" ),
2611
+ {NLs::PathExist,
2612
+ NLs::DomainLimitsIs (lowLimits.MaxPaths , lowLimits.MaxShards , lowLimits.MaxPQPartitions )});
2613
+
2614
+ {
2615
+ TestCreateSubDomain (runtime, txId++, " /MyRoot" ,
2616
+ " PlanResolution: 50 "
2617
+ " Coordinators: 1 "
2618
+ " Mediators: 1 "
2619
+ " TimeCastBucketsPerMediator: 2 "
2620
+ " Name: \" USER_0\" "
2621
+ " DatabaseQuotas {"
2622
+ " data_stream_shards_quota: 2"
2623
+ " data_stream_reserved_storage_quota: 200000"
2624
+ " }" );
2625
+ }
2626
+
2627
+ // create column tables, column limits
2628
+ {
2629
+ TestMkDir (runtime, txId++, " /MyRoot/USER_0" , " C" );
2630
+ env.TestWaitNotification (runtime, txId - 1 );
2631
+
2632
+ // MaxColumnTableColumns
2633
+ TestCreateColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2634
+ Name: "C2"
2635
+ ColumnShardCount: 1
2636
+ Schema {
2637
+ Columns { Name: "RowId" Type: "Uint64", NotNull: true }
2638
+ Columns { Name: "Value0" Type: "Utf8" }
2639
+ Columns { Name: "Value1" Type: "Utf8" }
2640
+ KeyColumnNames: "RowId"
2641
+ Engine: COLUMN_ENGINE_REPLACING_TIMESERIES
2642
+ }
2643
+ )" , {NKikimrScheme::StatusAccepted});
2644
+ env.TestWaitNotification (runtime, txId - 1 );
2645
+
2646
+ TestAlterColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2647
+ Name: "C2"
2648
+ AlterSchema {
2649
+ DropColumns {Name: "Value0"}
2650
+ }
2651
+ )" , {NKikimrScheme::StatusAccepted});
2652
+ env.TestWaitNotification (runtime, txId - 1 );
2653
+
2654
+ TestAlterColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2655
+ Name: "C2"
2656
+ AlterSchema {
2657
+ DropColumns {Name: "Value1"}
2658
+ AddColumns { Name: "Value2" Type: "Utf8" }
2659
+ AddColumns { Name: "Value3" Type: "Utf8" }
2660
+ AddColumns { Name: "Value4" Type: "Utf8" }
2661
+ }
2662
+ )" , {NKikimrScheme::StatusSchemeError});
2663
+ env.TestWaitNotification (runtime, txId - 1 );
2664
+
2665
+ TestCreateColumnTable (runtime, txId++, " /MyRoot/USER_0/C" , R"(
2666
+ Name: "C1"
2667
+ ColumnShardCount: 1
2668
+ Schema {
2669
+ Columns { Name: "RowId" Type: "Uint64", NotNull: true }
2670
+ Columns { Name: "Value0" Type: "Utf8" }
2671
+ Columns { Name: "Value1" Type: "Utf8" }
2672
+ Columns { Name: "Value2" Type: "Utf8" }
2673
+ KeyColumnNames: "RowId"
2674
+ Engine: COLUMN_ENGINE_REPLACING_TIMESERIES
2675
+ }
2676
+ )" , {NKikimrScheme::StatusSchemeError});
2677
+
2678
+ TString olapSchema = R"(
2679
+ Name: "OlapStore1"
2680
+ ColumnShardCount: 1
2681
+ SchemaPresets {
2682
+ Name: "default"
2683
+ Schema {
2684
+ Columns { Name: "timestamp" Type: "Timestamp" NotNull: true }
2685
+ Columns { Name: "data" Type: "Utf8" }
2686
+ KeyColumnNames: "timestamp"
2687
+ Engine: COLUMN_ENGINE_REPLACING_TIMESERIES
2688
+ }
2689
+ }
2690
+ )" ;
2691
+
2692
+ TestCreateOlapStore (runtime, txId++, " /MyRoot" , olapSchema, {NKikimrScheme::StatusAccepted});
2693
+ env.TestWaitNotification (runtime, txId - 1 );
2694
+
2695
+ TString olapSchemaBig = R"(
2696
+ Name: "OlapStoreBig"
2697
+ ColumnShardCount: 1
2698
+ SchemaPresets {
2699
+ Name: "default"
2700
+ Schema {
2701
+ Columns { Name: "timestamp" Type: "Timestamp" NotNull: true }
2702
+ Columns { Name: "data" Type: "Utf8" }
2703
+ Columns { Name: "data2" Type: "Utf8" }
2704
+ Columns { Name: "data3" Type: "Utf8" }
2705
+ KeyColumnNames: "timestamp"
2706
+ Engine: COLUMN_ENGINE_REPLACING_TIMESERIES
2707
+ }
2708
+ }
2709
+ )" ;
2710
+
2711
+ TestCreateOlapStore (runtime, txId++, " /MyRoot" , olapSchemaBig, {NKikimrScheme::StatusSchemeError});
2712
+ env.TestWaitNotification (runtime, txId - 1 );
2713
+
2714
+ TestAlterOlapStore (runtime, txId++, " /MyRoot" , R"(
2715
+ Name: "OlapStore1"
2716
+ AlterSchemaPresets {
2717
+ Name: "default"
2718
+ AlterSchema {
2719
+ AddColumns { Name: "comment" Type: "Utf8" }
2720
+ }
2721
+ }
2722
+ )" , {NKikimrScheme::StatusAccepted});
2723
+ env.TestWaitNotification (runtime, txId - 1 );
2724
+
2725
+ TestAlterOlapStore (runtime, txId++, " /MyRoot" , R"(
2726
+ Name: "OlapStore1"
2727
+ AlterSchemaPresets {
2728
+ Name: "default"
2729
+ AlterSchema {
2730
+ AddColumns { Name: "comment2" Type: "Utf8" }
2731
+ }
2732
+ }
2733
+ )" , {NKikimrScheme::StatusSchemeError});
2734
+ env.TestWaitNotification (runtime, txId - 1 );
2735
+ }
2736
+ }
2737
+
2588
2738
Y_UNIT_TEST (SchemeLimitsRejectsWithIndexedTables) {
2589
2739
TTestBasicRuntime runtime;
2590
2740
TTestEnv env (runtime);
0 commit comments