Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
f71748df
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f71748df
编写于
2月 01, 2018
作者:
A
Ashwin Agrawal
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Vacuum fix for ERROR updated tuple is already HEAP_MOVED_OFF."
This reverts commit
508ffd48
.
上级
508ffd48
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
4 addition
and
89 deletion
+4
-89
src/backend/cdb/cdbdistributedsnapshot.c
src/backend/cdb/cdbdistributedsnapshot.c
+0
-9
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+4
-8
src/test/isolation2/expected/vacuum_full_recently_dead_tuple_due_to_distributed_snapshot.out
..._full_recently_dead_tuple_due_to_distributed_snapshot.out
+0
-43
src/test/isolation2/isolation2_schedule
src/test/isolation2/isolation2_schedule
+0
-1
src/test/isolation2/sql/vacuum_full_recently_dead_tuple_due_to_distributed_snapshot.sql
..._full_recently_dead_tuple_due_to_distributed_snapshot.sql
+0
-28
未找到文件。
src/backend/cdb/cdbdistributedsnapshot.c
浏览文件 @
f71748df
...
...
@@ -52,15 +52,6 @@ localXidSatisfiesAnyDistributedSnapshot(TransactionId localXid)
DistributedSnapshotCommitted
distributedSnapshotCommitted
;
Assert
(
TransactionIdIsNormal
(
localXid
));
/*
* In general expect this function to be called only for normal xid, as
* more performant for caller to avoid the call based on
* TransactionIdIsNormal() check but just in case was called can safely
* return false.
*/
if
(
!
TransactionIdIsNormal
(
localXid
))
return
false
;
/*
* For single user mode operation like initdb time, let the vacuum
* cleanout and freeze tuples.
...
...
src/backend/commands/vacuum.c
浏览文件 @
f71748df
...
...
@@ -3732,10 +3732,8 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
* separately movable chain, ignoring any intervening DEAD ones.
*/
if
(((
tuple
.
t_data
->
t_infomask
&
HEAP_UPDATED
)
&&
(
!
TransactionIdPrecedes
(
HeapTupleHeaderGetXmin
(
tuple
.
t_data
),
OldestXmin
)
||
(
!
(
tuple
.
t_data
->
t_infomask2
&
HEAP_XMIN_DISTRIBUTED_SNAPSHOT_IGNORE
)
&&
localXidSatisfiesAnyDistributedSnapshot
(
HeapTupleHeaderGetXmin
(
tuple
.
t_data
)))))
||
!
TransactionIdPrecedes
(
HeapTupleHeaderGetXmin
(
tuple
.
t_data
),
OldestXmin
))
||
(
!
(
tuple
.
t_data
->
t_infomask
&
(
HEAP_XMAX_INVALID
|
HEAP_IS_LOCKED
))
&&
!
(
ItemPointerEquals
(
&
(
tuple
.
t_self
),
...
...
@@ -3923,10 +3921,8 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
/* Done if at beginning of chain */
if
(
!
(
tp
.
t_data
->
t_infomask
&
HEAP_UPDATED
)
||
(
TransactionIdPrecedes
(
HeapTupleHeaderGetXmin
(
tp
.
t_data
),
OldestXmin
)
&&
((
tuple
.
t_data
->
t_infomask2
&
HEAP_XMIN_DISTRIBUTED_SNAPSHOT_IGNORE
)
||
!
localXidSatisfiesAnyDistributedSnapshot
(
HeapTupleHeaderGetXmin
(
tp
.
t_data
)))))
TransactionIdPrecedes
(
HeapTupleHeaderGetXmin
(
tp
.
t_data
),
OldestXmin
))
break
;
/* out of check-all-items loop */
/* Move to tuple with prior row version */
...
...
src/test/isolation2/expected/vacuum_full_recently_dead_tuple_due_to_distributed_snapshot.out
已删除
100644 → 0
浏览文件 @
508ffd48
-- Test to validate bug fix for vacuum full and distributed snapshot.
--
-- Scenarios is where locally on segment tuple's xmin and xmax is lower than
-- OldestXmin and hence safely can be declared DEAD but based on distributed
-- snapshot HeapTupleSatisfiesVacuum() returns HEAPTUPLE_RECENTLY_DEAD. Later
-- though while moving the tuples around as part of vacuum, distributed snapshot
-- was not consulted but instead xmin was only checked against OldestXmin
-- raising the "ERROR: updated tuple is already HEAP_MOVED_OFF".
create table test_recently_dead_utility(a int, b int, c text);
CREATE
-- Insert enough data that it doesn't all fit in one page.
insert into test_recently_dead_utility select 1, g, 'foobar' from generate_series(1, 1000) g;
INSERT 1000
-- Perform updates to form update chains and deleted tuples.
update test_recently_dead_utility set b = 1;
UPDATE 1000
update test_recently_dead_utility set b = 1;
UPDATE 1000
-- Run VACUUM FULL in utility mode. It sees some of the old, updated, tuple
-- versions as HEAPTUPLE_RECENTLY_DEAD, even though they are safely dead because
-- localXidSatisfiesAnyDistributedSnapshot() is conservative and returns 'true'
-- in utility mode. Helps to validate doesn't surprise the chain-following logic
-- in VACUUM FULL.
0U: vacuum full verbose test_recently_dead_utility;
VACUUM
0U: select count(*) from test_recently_dead_utility;
count
-----
1000
(1 row)
0U: set gp_select_invisible=1;
SET
-- print to make sure deleted tuples were not cleaned due to distributed
-- snapshot to make test is future proof, if logic in
-- localXidSatisfiesAnyDistributedSnapshot() changes for utility mode.
0U: select count(*) from test_recently_dead_utility;
count
-----
2000
(1 row)
0U: set gp_select_invisible=0;
SET
src/test/isolation2/isolation2_schedule
浏览文件 @
f71748df
...
...
@@ -11,7 +11,6 @@ test: drop_rename
test: instr_in_shmem_setup
test: instr_in_shmem_terminate
test: instr_in_shmem_cleanup
test: vacuum_full_recently_dead_tuple_due_to_distributed_snapshot
test: setup
# Tests on Append-Optimized tables (row-oriented).
...
...
src/test/isolation2/sql/vacuum_full_recently_dead_tuple_due_to_distributed_snapshot.sql
已删除
100644 → 0
浏览文件 @
508ffd48
-- Test to validate bug fix for vacuum full and distributed snapshot.
--
-- Scenarios is where locally on segment tuple's xmin and xmax is lower than
-- OldestXmin and hence safely can be declared DEAD but based on distributed
-- snapshot HeapTupleSatisfiesVacuum() returns HEAPTUPLE_RECENTLY_DEAD. Later
-- though while moving the tuples around as part of vacuum, distributed snapshot
-- was not consulted but instead xmin was only checked against OldestXmin
-- raising the "ERROR: updated tuple is already HEAP_MOVED_OFF".
create
table
test_recently_dead_utility
(
a
int
,
b
int
,
c
text
);
-- Insert enough data that it doesn't all fit in one page.
insert
into
test_recently_dead_utility
select
1
,
g
,
'foobar'
from
generate_series
(
1
,
1000
)
g
;
-- Perform updates to form update chains and deleted tuples.
update
test_recently_dead_utility
set
b
=
1
;
update
test_recently_dead_utility
set
b
=
1
;
-- Run VACUUM FULL in utility mode. It sees some of the old, updated, tuple
-- versions as HEAPTUPLE_RECENTLY_DEAD, even though they are safely dead because
-- localXidSatisfiesAnyDistributedSnapshot() is conservative and returns 'true'
-- in utility mode. Helps to validate doesn't surprise the chain-following logic
-- in VACUUM FULL.
0
U
:
vacuum
full
verbose
test_recently_dead_utility
;
0
U
:
select
count
(
*
)
from
test_recently_dead_utility
;
0
U
:
set
gp_select_invisible
=
1
;
-- print to make sure deleted tuples were not cleaned due to distributed
-- snapshot to make test is future proof, if logic in
-- localXidSatisfiesAnyDistributedSnapshot() changes for utility mode.
0
U
:
select
count
(
*
)
from
test_recently_dead_utility
;
0
U
:
set
gp_select_invisible
=
0
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录