Altering a space takes effect immediately.
Before this patch, the new space, created by alter specification, would be put into space cache only after successful WAL write. This behaviour is not linearizable: on a replica, the WAL is played sequentially, and the order of events could differ from the master. Besides, it could crash, as demonstrated in gh-2074 test case. Since we use a cascading rollback for all transactions on WAL write error, it's OK to put a space into space cache before WAL write, so that the new transactions apply to the new space. This patch does exactly that. All subsequent requests are executed against the new space. This patch also removes on_replace trigger in the old space, since all checks against the new tuple format are performed using the new space. Fixes #2074.
Loading
Please register or sign in to comment