diff options
author | alexbogo <alexbogo@ydb.tech> | 2022-12-16 14:31:40 +0300 |
---|---|---|
committer | alexbogo <alexbogo@ydb.tech> | 2022-12-16 14:31:40 +0300 |
commit | 878e605686b4bf9b99124dde8df0fd048a8098b5 (patch) | |
tree | 9af3ace6d9c0af6cb4d3134c37a418d2eb4a7ce4 | |
parent | 1a247b8cc6aa63ee61d8539ec969885b3ee9591e (diff) | |
download | ydb-878e605686b4bf9b99124dde8df0fd048a8098b5.tar.gz |
[ymq] set default tables format = v1 (common tables)
init
6 files changed, 23 insertions, 6 deletions
diff --git a/ydb/core/ymq/actor/queue_schema.cpp b/ydb/core/ymq/actor/queue_schema.cpp index b25b7bde05..b7b81610ae 100644 --- a/ydb/core/ymq/actor/queue_schema.cpp +++ b/ydb/core/ymq/actor/queue_schema.cpp @@ -450,7 +450,7 @@ void TCreateQueueSchemaActorV2::RequestTablesFormatSettings(const TString& accou auto* trans = ev->Record.MutableTransaction()->MutableMiniKQLTransaction(); TParameters(trans->MutableParams()->MutableProto()) .Utf8("USER_NAME", accountName) - .Uint32("DEFAULT_TABLES_FORMAT", 0); + .Uint32("DEFAULT_TABLES_FORMAT", 1); Register(new TMiniKqlExecutionActor(SelfId(), RequestId_, std::move(ev), false, QueuePath_, GetTransactionCounters(UserCounters_))); } diff --git a/ydb/tests/functional/sqs/common/test_counters.py b/ydb/tests/functional/sqs/common/test_counters.py index aebfd1b14f..08db16c37c 100644 --- a/ydb/tests/functional/sqs/common/test_counters.py +++ b/ydb/tests/functional/sqs/common/test_counters.py @@ -23,8 +23,14 @@ class TestSqsCountersFeatures(KikimrSqsTestBase): attributes_path = self._smart_make_table_path(self._username, self.queue_name, version, None, 'Attributes') deadline = int((time.time() + 600) * 1000) - self._execute_yql_query('UPSERT INTO `{}` (State, ShowDetailedCountersDeadline) VALUES (0, {})' - .format(attributes_path, deadline)) + query_key = {'name': 'State', 'value': 0} + if self.get_tables_format() != 0: + query_key = {'name': 'QueueIdNumber', 'value': self._get_queue_version_number(self._username, self.queue_name)} + + self._execute_yql_query( + f'''UPDATE `{attributes_path}` SET ShowDetailedCountersDeadline = {deadline} + WHERE {query_key['name']} = {query_key['value']}''' + ) @pytest.mark.parametrize(**TABLES_FORMAT_PARAMS) def test_creates_counter(self, tables_format): diff --git a/ydb/tests/functional/sqs/common/test_queues_managing.py b/ydb/tests/functional/sqs/common/test_queues_managing.py index 1e207b84de..992e3d37fe 100644 --- a/ydb/tests/functional/sqs/common/test_queues_managing.py +++ b/ydb/tests/functional/sqs/common/test_queues_managing.py @@ -299,7 +299,7 @@ class QueuesManagingTest(KikimrSqsTestBase): @pytest.mark.parametrize(**IS_FIFO_PARAMS) def test_delete_and_create_queue(self, is_fifo): - self._init_with_params(is_fifo) + self._init_with_params(is_fifo, tables_format=0) created_queue_url = self._create_queue_and_assert(self.queue_name, is_fifo=is_fifo, use_http=True) self.seq_no += 1 diff --git a/ydb/tests/functional/sqs/messaging/test_fifo_messaging.py b/ydb/tests/functional/sqs/messaging/test_fifo_messaging.py index dbc269bc0a..fbbe0c3eb4 100644 --- a/ydb/tests/functional/sqs/messaging/test_fifo_messaging.py +++ b/ydb/tests/functional/sqs/messaging/test_fifo_messaging.py @@ -54,6 +54,7 @@ class SqsFifoMessagingTest(KikimrSqsTestBase): return config_generator def test_only_single_read_infly_from_fifo(self): + self._init_with_params(tables_format=0) self._create_queue_send_x_messages_read_y_messages( self.queue_name, send_count=10, read_count=1, visibility_timeout=1000, msg_body_template=self._msg_body_template, is_fifo=True @@ -63,6 +64,7 @@ class SqsFifoMessagingTest(KikimrSqsTestBase): ) def test_fifo_read_delete_single_message(self): + self._init_with_params(tables_format=0) created_queue_url = self._create_queue_and_assert(self.queue_name, is_fifo=True) message_ids = self._send_messages( created_queue_url, message_count=10, msg_body_template=self._msg_body_template, is_fifo=True, group_id='group' diff --git a/ydb/tests/functional/sqs/multinode/test_multinode_cluster.py b/ydb/tests/functional/sqs/multinode/test_multinode_cluster.py index 8a431a90a4..c5a8af816c 100644 --- a/ydb/tests/functional/sqs/multinode/test_multinode_cluster.py +++ b/ydb/tests/functional/sqs/multinode/test_multinode_cluster.py @@ -59,7 +59,7 @@ class TestSqsMultinodeCluster(KikimrSqsTestBase): @pytest.mark.parametrize(**IS_FIFO_PARAMS) @pytest.mark.parametrize(**STOP_NODE_PARAMS) def test_has_messages_counters(self, is_fifo, stop_node): - self._init_with_params(is_fifo) + self._init_with_params(is_fifo, tables_format=0) self._create_queue_and_assert(self.queue_name, is_fifo=is_fifo) node_index = self._get_queue_master_node_index() logging.debug('Master node for queue "{}" is {}'.format(self.queue_name, node_index)) @@ -144,6 +144,7 @@ class TestSqsMultinodeCluster(KikimrSqsTestBase): @pytest.mark.parametrize(**STOP_NODE_PARAMS) def test_reassign_master(self, stop_node): + self._init_with_params(tables_format=0) self._create_queue_and_assert(self.queue_name) node_index = self._get_queue_master_node_index() proxy_node_index = self._other_node(node_index) @@ -192,6 +193,7 @@ class TestSqsMultinodeCluster(KikimrSqsTestBase): self.receive_message_finished = True def test_ends_request_after_kill(self): + self._init_with_params(tables_format=0) self._create_queue_and_assert(self.queue_name) node_index = self._get_queue_master_node_index() self.receive_message_finished = False diff --git a/ydb/tests/library/sqs/test_base.py b/ydb/tests/library/sqs/test_base.py index bd8bd87a1c..138ca4608a 100644 --- a/ydb/tests/library/sqs/test_base.py +++ b/ydb/tests/library/sqs/test_base.py @@ -25,6 +25,8 @@ from concurrent import futures DEFAULT_VISIBILITY_TIMEOUT = 30 +DEFAULT_TABLES_FORMAT = 1 + logger = logging.getLogger(__name__) @@ -245,6 +247,11 @@ class KikimrSqsTestBase(object): ) ) + def get_tables_format(self, user=None): + if user is None: + user = self._username + return self.tables_format_per_user.get(user, DEFAULT_TABLES_FORMAT) + def check_all_users_queues_tables_consistency(self): users = [entry.name for entry in self._driver.scheme_client.list_directory(self.sqs_root).children] for user in users: @@ -642,7 +649,7 @@ class KikimrSqsTestBase(object): time.sleep(1) # wait node to start def _smart_make_table_path(self, user_name, queue_name, queue_version, shard, table_name): - tables_format = self.tables_format_per_user.get(user_name, 0) + tables_format = self.get_tables_format(user_name) table_path = self.sqs_root if tables_format == 0: |