From a17c0dffdcfd9a26d0d4ac9689c64278c4f828f3 Mon Sep 17 00:00:00 2001 From: Igor Zolotarev Date: Tue, 14 Jan 2025 23:16:26 +0300 Subject: [PATCH] Don't fetch schema in inner `pool.connect` calls --- CHANGELOG.rst | 2 ++ cartridge/lua-api/boxinfo.lua | 2 +- cartridge/lua-api/compression.lua | 4 ++-- cartridge/lua-api/proxy.lua | 2 +- cartridge/lua-api/stat.lua | 2 +- cartridge/roles/vshard-router.lua | 2 +- cartridge/vshard-utils.lua | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3814e7ea0..b2758a268 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,6 +24,8 @@ Changed - Update ``membership`` dependency to `2.4.6 `_. +- Cartridge doesn't fetch schema in inner ``pool.connect`` calls. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Added ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cartridge/lua-api/boxinfo.lua b/cartridge/lua-api/boxinfo.lua index 1d3209fac..36b5b68d0 100644 --- a/cartridge/lua-api/boxinfo.lua +++ b/cartridge/lua-api/boxinfo.lua @@ -246,7 +246,7 @@ local function get_info(uri) return ret end - local conn, err = pool.connect(uri, {wait_connected = false}) + local conn, err = pool.connect(uri, {wait_connected = false, fetch_schema = false}) if not conn then return nil, err end diff --git a/cartridge/lua-api/compression.lua b/cartridge/lua-api/compression.lua index de5f58056..fddd8c7a4 100644 --- a/cartridge/lua-api/compression.lua +++ b/cartridge/lua-api/compression.lua @@ -31,7 +31,7 @@ local function get_cluster_compression_info() if role == 'vshard-storage' then local master = rpl.master - local conn, err = pool.connect(master.uri, {wait_connected = true}) + local conn, err = pool.connect(master.uri, {wait_connected = true, fetch_schema = false}) if not conn or err ~= nil then if err ~= nil then log.error(err) @@ -49,7 +49,7 @@ local function get_cluster_compression_info() ) if storage_compression_info == nil or err ~= nil then - if err ~=nil then + if err ~= nil then log.error(err) end table.insert(compression_info, { diff --git a/cartridge/lua-api/proxy.lua b/cartridge/lua-api/proxy.lua index 8ff8ecaac..b82b31ea7 100644 --- a/cartridge/lua-api/proxy.lua +++ b/cartridge/lua-api/proxy.lua @@ -49,7 +49,7 @@ local function call(function_name, ...) checks('string') local destination = get_destination() - local conn = pool.connect(destination, {wait_connected = false}) + local conn = pool.connect(destination, {wait_connected = false, fetch_schema = false}) -- Both get_topology and edit_topology API return recursive lua -- tables which can't be passed over netbox as is. So we transfer diff --git a/cartridge/lua-api/stat.lua b/cartridge/lua-api/stat.lua index c3c0b5d77..f48e0f2d9 100644 --- a/cartridge/lua-api/stat.lua +++ b/cartridge/lua-api/stat.lua @@ -45,7 +45,7 @@ local function get_stat(uri) } end - local conn, err = pool.connect(uri, {wait_connected = false}) + local conn, err = pool.connect(uri, {wait_connected = false, fetch_schema = false}) if not conn then return nil, err end diff --git a/cartridge/roles/vshard-router.lua b/cartridge/roles/vshard-router.lua index 3d704ea16..04cd1c6a3 100644 --- a/cartridge/roles/vshard-router.lua +++ b/cartridge/roles/vshard-router.lua @@ -192,7 +192,7 @@ local function bootstrap_group(group_name, vsgroup) for _, replicaset in pairs(info.replicasets or {}) do local uri = replicaset.master.uri local ready = errors.netbox_eval( - pool.connect(uri, {wait_connected = false}), + pool.connect(uri, {wait_connected = false, fetch_schema = false}), 'return box.space._bucket ~= nil', {}, {timeout = 1} ) diff --git a/cartridge/vshard-utils.lua b/cartridge/vshard-utils.lua index 3b2c152ad..cc43b72e3 100644 --- a/cartridge/vshard-utils.lua +++ b/cartridge/vshard-utils.lua @@ -145,7 +145,7 @@ local function validate_group_upgrade(group_name, topology_new, topology_old) local master_uri = servers_old[master_uuid].uri local buckets_count, _ = errors.netbox_call( - pool.connect(master_uri, {wait_connected = false}), + pool.connect(master_uri, {wait_connected = false, fetch_schema = false}), 'vshard.storage.buckets_count', nil, {timeout = 1} )