Skip to content

core: protect ro nodes on disconnect#252

Open
Col-Waltz wants to merge 1 commit into
masterfrom
Col-Waltz/protect-disconnect-on-ro
Open

core: protect ro nodes on disconnect#252
Col-Waltz wants to merge 1 commit into
masterfrom
Col-Waltz/protect-disconnect-on-ro

Conversation

@Col-Waltz

Copy link
Copy Markdown

Adds protection for on_disconnect trigger. After leader change it may return ERR_READONLY while deleting consumers. Now this trigger performs only local operations on ro node.

@oleg-jukovec oleg-jukovec left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a changelog entry + link to the PR: #248

Comment thread queue/abstract.lua
Comment thread queue/abstract.lua
@Col-Waltz Col-Waltz force-pushed the Col-Waltz/protect-disconnect-on-ro branch from 89e9d3e to 7195d22 Compare June 11, 2026 10:54
@Col-Waltz Col-Waltz requested a review from oleg-jukovec June 11, 2026 11:21

@oleg-jukovec oleg-jukovec left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, describe the change for a user in the CHANGELOG.md.

Comment thread t/240-ro-on-disconnect.t Outdated
Comment thread t/240-ro-on-disconnect.t Outdated
Comment thread t/240-ro-on-disconnect.t
@Col-Waltz Col-Waltz force-pushed the Col-Waltz/protect-disconnect-on-ro branch from 7195d22 to da46d48 Compare June 18, 2026 09:28
@Col-Waltz Col-Waltz requested a review from oleg-jukovec June 18, 2026 09:32
Comment thread CHANGELOG.md Outdated
Adds protection for on_disconnect trigger. After leader change
it may return ERR_READONLY while deleting consumers. Now this
trigger performs only local operations on ro node.
@Col-Waltz Col-Waltz force-pushed the Col-Waltz/protect-disconnect-on-ro branch from da46d48 to 3b53938 Compare June 18, 2026 14:06
@Col-Waltz Col-Waltz requested a review from oleg-jukovec June 18, 2026 14:07
Comment thread queue/abstract.lua
return make_self(driver, space, name, tube_type, id, opts)
end

-- function cleans local temporary spaces on startup to avoid

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A sentence should be started with capital letter.
https://www.tarantool.io/en/doc/latest/contributing/lua_style_guide/#commenting

Suggested change
-- function cleans local temporary spaces on startup to avoid
-- Cleans local temporary spaces on startup to avoid

Comment thread queue/abstract.lua
-- The "RUNNING" and "WAITING" states do not require additional actions.
local function on_state_change(state)
if state == queue_state.states.STARTUP then
cleanup_temp_spaces()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please provide the test that checks cleanup after RW->RO->RW transition?
It seems to me, this case does not covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants