提交 e92dcf83 编写于 作者: A Ashwin Agrawal

Test to validate vacuum doesn't remove tuples that are still needed.

上级 3c75d515
Parsed test spec with 2 sessions
starting permutation: s1begin s1delete s2begin s1commit s1vacuum s2select
step s1begin: begin;
step s1delete: delete from heaptest;
step s2begin: BEGIN ISOLATION LEVEL SERIALIZABLE;
select 123 as "establish snapshot";
establish snapshot
123
step s1commit: commit;
step s1vacuum: vacuum heaptest;
step s2select: select count(*) from heaptest;
count
100
# GPDB-specific tests
test: heap-serializable-vacuum
test: ao-serializable-read
test: ao-serializable-vacuum
test: ao-insert-eof
# Test behaviour with distributed (serializable) snapshots and vacuum.
#
# The crux of this test is that session 2 begins a serializable
# transaction, but it doesn't immediately do any actions in that transaction
# that would open the connections to the QEs. Hence, GetSnapshotData() isn't
# called in the QEs for session 2 the "s2select" stage. Meanwhile, session 1
# deletes rows from the table that session 2 later needs to see, and runs
# vacuum. If there is no mechanism to prevent the global "oldest xmin" from
# advancing, it will merrily vacuum away tuples that session 2 needs to see
# later.
#
# In a single-node system, the dummy "establish snapshot" query will set
# MyProc->xmin and prevent the tuples it needs to see later from being
# vacuumed away. In MPP, the dummy query establishes a distributed snapshot,
# but that doesn't immediately set the xmin values in QEs.
setup
{
create table heaptest (i int, j int);
insert into heaptest select i, i from generate_series(0, 99) i;
}
teardown
{
drop table if exists heaptest;
}
session "s1"
step "s1begin" { begin; }
step "s1delete" { delete from heaptest; }
step "s1commit" { commit; }
step "s1vacuum" { vacuum heaptest; }
session "s2"
step "s2begin" { BEGIN ISOLATION LEVEL SERIALIZABLE;
select 123 as "establish snapshot"; }
step "s2select" { select count(*) from heaptest; }
teardown { abort; }
permutation "s1begin" "s1delete" "s2begin" "s1commit" "s1vacuum" "s2select"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册