Skip to content
Snippets Groups Projects
Commit a6dc7e99 authored by Dmitry Rodionov's avatar Dmitry Rodionov Committed by Yaroslav Dynnikov
Browse files

refactor: split reenterable_schema_change_request

Previously function was ~700 loc. The patch splits out the logic of
conversion from ir node to operation. Previously there were two stages,
initial validation that constructed intermediate structure and then
intermediate structure was transformed into Op potentially several times
in case of retries. The patch removes intermediate conversion by
direct mapping from ir node to op. It makes reading more convenient
since there is no need to jump back and forth between initial checks and
actual Op construction. Another benefit is that some checks need to be
repeated on each retry since retries originate from conflicts and
conflicts change system state. So in newer state operation may no longer
make sense. By coupling both operations together there is no way a check
can be missed in the retry phase.

We still do some cloning here and there. We can probably improve on that
by constructing Op once and then adjusting it in place for conflicts but
since retries should be rare in practice it shouldnt be a problem.

Additionally we do a lot of conversion between SmolStr and String. We
need to use SmolStr in more placese inside picodata so we dont need to
do that.
parent 7361172c
No related branches found
No related tags found
1 merge request!1193refactor: split reenterable_schema_change_request
Pipeline #48122 failed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment