Skip to content

Commit

Permalink
storage: check backoff errors
Browse files Browse the repository at this point in the history
Before this patch, it was possible to get a successful storage info
response, while some replicas still could be treated as erroneous
(backoff) by vshard ro calls.
  • Loading branch information
DifferentialOrange committed Mar 27, 2024
1 parent 8360efa commit d54b808
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
* Explicitly forbid datetime interval conditions (#373).
* Storage initialization is now asynchronous by default for Tarantool 3.0+ (#412).
* Additionally check backoff error on storage info fetch (#427).

### Fixed
* Working with datetime conditions in case of non-indexed fields or
Expand Down
24 changes: 14 additions & 10 deletions crud/storage_info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,22 @@ function storage_info.call(opts)
is_master = master == replica
}

local ok, res = pcall(replica.conn.call, replica.conn, CRUD_STORAGE_INFO_FUNC_NAME,
{}, async_opts)
if ok then
futures_by_replicas[replica_id] = res
if replica.backoff_err ~= nil then
replica_state_by_id[replica_id].message = tostring(replica.backoff_err)
else
local err_msg = string.format("Error getting storage info for %s", replica_id)
if res ~= nil then
log.error("%s: %s", err_msg, res)
replica_state_by_id[replica_id].message = tostring(res)
local ok, res = pcall(replica.conn.call, replica.conn, CRUD_STORAGE_INFO_FUNC_NAME,
{}, async_opts)
if ok then
futures_by_replicas[replica_id] = res
else
log.error(err_msg)
replica_state_by_id[replica_id].message = err_msg
local err_msg = string.format("Error getting storage info for %s", replica_id)
if res ~= nil then
log.error("%s: %s", err_msg, res)
replica_state_by_id[replica_id].message = tostring(res)
else
log.error(err_msg)
replica_state_by_id[replica_id].message = err_msg
end
end
end
end
Expand Down

0 comments on commit d54b808

Please sign in to comment.