Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure in memtx transaction manager #8104

Closed
CuriousGeorgiy opened this issue Dec 29, 2022 · 1 comment · Fixed by #8167
Closed

Assertion failure in memtx transaction manager #8104

CuriousGeorgiy opened this issue Dec 29, 2022 · 1 comment · Fixed by #8167
Assignees
Labels
2.10 Target is 2.10 and all newer release/master branches bug Something isn't working crash memtx mvcc

Comments

@CuriousGeorgiy
Copy link
Member

CuriousGeorgiy commented Dec 29, 2022

Steps to reproduce

os.execute('rm -rf *.snap *.xlog *.vylog 512')

local fiber = require('fiber')
local ffi = require('ffi')

box.cfg{memtx_use_mvcc_engine = true}

local s = box.schema.space.create('s')
s:create_index('pk')

s:replace{0}

local first_replace = fiber.new(function()
    box.atomic(function()
        s:delete{0}
    end)
end)
local second_replace = fiber.new(function()
    box.atomic(function()
        s:replace{0}
    end)
end)

first_replace:set_joinable(true)
second_replace:set_joinable(true)

first_replace:join()
second_replace:join()

os.exit()

Actual behavior

Assertion failed: (test_stmt->txn->psn == 0), function memtx_tx_history_prepare_insert_stmt, file memtx_tx.c, line 2485.

Expected behavior

Script is successfully executed.

@CuriousGeorgiy CuriousGeorgiy added crash bug Something isn't working memtx mvcc labels Dec 29, 2022
@alyapunov alyapunov self-assigned this Dec 29, 2022
@CuriousGeorgiy
Copy link
Member Author

Related to #7930.

CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jan 17, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story, but the story is deleted by a
prepared (not necessarily committed) transaction, we consider that it
de-facto does not exist anymore — this logic is consistent, since during
preparation of the transaction deleting this story, the conflict resolution
described above was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jan 19, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story, but the story is deleted by a
prepared (not necessarily committed) transaction, we consider that it
de-facto does not exist anymore — this logic is consistent, since during
preparation of the transaction deleting this story, the conflict resolution
described above was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jan 19, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix
@kyukhin kyukhin added the 2.10 Target is 2.10 and all newer release/master branches label Jan 19, 2023
alyapunov pushed a commit that referenced this issue Jan 23, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes #8104

NO_DOC=bugfix
ochaplashkin pushed a commit to ochaplashkin/tarantool that referenced this issue Jan 25, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix
ochaplashkin pushed a commit to ochaplashkin/tarantool that referenced this issue Jan 25, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix
alyapunov pushed a commit to alyapunov/tarantool that referenced this issue Jan 26, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix

(cherry picked from commit d7cf6f6)
alyapunov pushed a commit to alyapunov/tarantool that referenced this issue Jan 26, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix

(cherry picked from commit d7cf6f6)
alyapunov pushed a commit that referenced this issue Jan 27, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes #8104

NO_DOC=bugfix

(cherry picked from commit d7cf6f6)
Lord-KA pushed a commit to Lord-KA/tarantool that referenced this issue Feb 27, 2023
During preparation of insert statements in MVCC, we define an old story and
abort all transactions that delete this story.

If there exists an older
story in the history chain, but the story is deleted by a prepared (not
necessarily committed) transaction, we consider that it de-facto does not
exist anymore — this logic is consistent, since during preparation of the
transaction deleting this story, the conflict resolution described above
was already done.

In this manner, there can be no more than one prepared statement deleting
a story at any point in time.

Closes tarantool#8104

NO_DOC=bugfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Target is 2.10 and all newer release/master branches bug Something isn't working crash memtx mvcc
Projects
None yet
3 participants