Skip to content
Snippets Groups Projects
Commit a0db136e authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy Committed by Roman Tsisyk
Browse files

vinyl: fix error in mem_restore on prepared statement

Between prepare and commit of a transaction it is possible
that some prepared statements are read from mem.
Prepared statement has abnomal lsn > MAX_LSN.

If version of the index is changed after return of a
prepared statement and the iterator is placed to read view,
the restart and restore on a such prepared statement could
lead to restore on LSN bigger than vlsn.

Example:

        FIBER 1                        FIBER 2
       box.begin()
 replace {1}, lsn=MAX_LSN+1
 replace {2}, lsn=MAX_LSN+1
    prepare vy_tx ...
                        ->->->      open iterator
                              read {1},lsn=MAX_LSN+1 from mem
                                     yield ...
                        <-<-<-
    commit vy_tx
 replace {1, 1},lsn=100
send iterator to read view
                        ->->->
                                 iterator read view = 100
                          index version changed - restore on last_stmt
                              last_stmt = {1},lsn=MAX_LSN+1
                              last_stmt LSN > iterator VLSN
                                 ??????????????????????

Lets return in such situations the next key.
parent d21971cd
No related branches found
No related tags found
No related merge requests found
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