Skip to content

Commit

Permalink
Add fetch_schema to rpc.get_connection
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Jan 15, 2025
1 parent 033ec75 commit 829ddcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Changed

- Update ``membership`` dependency to `2.4.6 <https://github.com/tarantool/membership/releases/tag/2.4.6>`_.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Added
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- ``fetch_schema`` option to ``rpc.get_connection``.

-------------------------------------------------------------------------------
[2.13.0] - 2024-11-28
-------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cartridge/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ local function get_connection(role_name, opts)
prefer_local = '?boolean',
leader_only = '?boolean',
labels = '?table',
fetch_schema = '?boolean',
})

local candidates = get_candidates(role_name, {leader_only = opts.leader_only, labels = opts.labels})
if next(candidates) == nil then
if opts.labels then
Expand All @@ -174,7 +174,7 @@ local function get_connection(role_name, opts)
num_candidates = num_candidates - 1

uri = table.remove(candidates, n)
conn = pool.connect(uri, {wait_connected = false})
conn = pool.connect(uri, {wait_connected = false, fetch_schema = opts.fetch_schema})
until conn:wait_connected() or num_candidates == 0

if not conn:is_connected() then
Expand Down

0 comments on commit 829ddcf

Please sign in to comment.