Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 441db7a

Browse files
committed
Do no clear visibility bitmap in snapshot
1 parent db21030 commit 441db7a

File tree

5 files changed

+824
-11
lines changed

5 files changed

+824
-11
lines changed

src/backend/access/heap/heapam.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4082,7 +4082,8 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
40824082
* overhead would be unchanged, that doesn't seem necessarily
40834083
* worthwhile.
40844084
*/
4085-
if (PageIsAllVisible(BufferGetPage(buffer)) &&
4085+
if (!SFS_IN_SNAPSHOT() &&
4086+
PageIsAllVisible(BufferGetPage(buffer)) &&
40864087
visibilitymap_clear(relation, block, vmbuffer,
40874088
VISIBILITYMAP_ALL_FROZEN))
40884089
cleared_all_frozen = true;
Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
Parsed test spec with 3 sessions
2+
3+
starting permutation: s3_mk_sn s1_check s1_g_1 s1_check s3_sw_3 s1_check
4+
step s3_mk_sn:
5+
select 1 from pg_make_snapshot();
6+
7+
?column?
8+
9+
1
10+
step s1_check:
11+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
12+
select count(*) as cnt from t1;
13+
14+
grantee grantor privilege_type tableowner
15+
16+
test_owner test_owner DELETE test_owner
17+
test_owner test_owner INSERT test_owner
18+
test_owner test_owner REFERENCES test_owner
19+
test_owner test_owner SELECT test_owner
20+
test_owner test_owner TRIGGER test_owner
21+
test_owner test_owner TRUNCATE test_owner
22+
test_owner test_owner UPDATE test_owner
23+
cnt
24+
25+
10
26+
step s1_g_1:
27+
grant select, insert, update, delete on t1 to test_role1;
28+
29+
step s1_check:
30+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
31+
select count(*) as cnt from t1;
32+
33+
grantee grantor privilege_type tableowner
34+
35+
test_owner test_owner DELETE test_owner
36+
test_owner test_owner INSERT test_owner
37+
test_owner test_owner REFERENCES test_owner
38+
test_owner test_owner SELECT test_owner
39+
test_owner test_owner TRIGGER test_owner
40+
test_owner test_owner TRUNCATE test_owner
41+
test_owner test_owner UPDATE test_owner
42+
test_role1 test_owner DELETE test_owner
43+
test_role1 test_owner INSERT test_owner
44+
test_role1 test_owner SELECT test_owner
45+
test_role1 test_owner UPDATE test_owner
46+
cnt
47+
48+
10
49+
step s3_sw_3:
50+
select pg_switch_to_snapshot( ( select recent_snapshot from pg_control_snapshot() ) );
51+
select 'СМОТРЕТЬ НИЖЕ';
52+
53+
pg_switch_to_snapshot
54+
55+
56+
?column?
57+
58+
СМОТРЕТЬ НИЖЕ
59+
step s1_check:
60+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
61+
select count(*) as cnt from t1;
62+
63+
grantee grantor privilege_type tableowner
64+
65+
cnt
66+
67+
10
68+
69+
starting permutation: s3_mk_sn s1_g_1 s3_mk_sn s1_g_2 s3_mk_sn s3_rc_sn_2 s1_check
70+
step s3_mk_sn:
71+
select 1 from pg_make_snapshot();
72+
73+
?column?
74+
75+
1
76+
step s1_g_1:
77+
grant select, insert, update, delete on t1 to test_role1;
78+
79+
step s3_mk_sn:
80+
select 1 from pg_make_snapshot();
81+
82+
?column?
83+
84+
1
85+
step s1_g_2:
86+
alter table t1 owner to test_role2;
87+
revoke all on t1 from test_role2;
88+
grant select, update, insert, delete on t1 to test_role2;
89+
90+
step s3_mk_sn:
91+
select 1 from pg_make_snapshot();
92+
93+
?column?
94+
95+
1
96+
step s3_rc_sn_2:
97+
select pg_recover_to_snapshot( ( select recent_snapshot - 1 from pg_control_snapshot() ) );
98+
99+
pg_recover_to_snapshot
100+
101+
102+
step s1_check:
103+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
104+
select count(*) as cnt from t1;
105+
106+
grantee grantor privilege_type tableowner
107+
108+
test_owner test_owner DELETE test_owner
109+
test_owner test_owner INSERT test_owner
110+
test_owner test_owner REFERENCES test_owner
111+
test_owner test_owner SELECT test_owner
112+
test_owner test_owner TRIGGER test_owner
113+
test_owner test_owner TRUNCATE test_owner
114+
test_owner test_owner UPDATE test_owner
115+
test_role1 test_owner DELETE test_owner
116+
test_role1 test_owner INSERT test_owner
117+
test_role1 test_owner SELECT test_owner
118+
test_role1 test_owner UPDATE test_owner
119+
cnt
120+
121+
10
122+
123+
starting permutation: s3_mk_sn s1_check s1_g_1 s1_check s3_sw_3 s1_check
124+
step s3_mk_sn:
125+
select 1 from pg_make_snapshot();
126+
127+
?column?
128+
129+
1
130+
step s1_check:
131+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
132+
select count(*) as cnt from t1;
133+
134+
grantee grantor privilege_type tableowner
135+
136+
test_owner test_owner DELETE test_owner
137+
test_owner test_owner INSERT test_owner
138+
test_owner test_owner REFERENCES test_owner
139+
test_owner test_owner SELECT test_owner
140+
test_owner test_owner TRIGGER test_owner
141+
test_owner test_owner TRUNCATE test_owner
142+
test_owner test_owner UPDATE test_owner
143+
cnt
144+
145+
10
146+
step s1_g_1:
147+
grant select, insert, update, delete on t1 to test_role1;
148+
149+
step s1_check:
150+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
151+
select count(*) as cnt from t1;
152+
153+
grantee grantor privilege_type tableowner
154+
155+
test_owner test_owner DELETE test_owner
156+
test_owner test_owner INSERT test_owner
157+
test_owner test_owner REFERENCES test_owner
158+
test_owner test_owner SELECT test_owner
159+
test_owner test_owner TRIGGER test_owner
160+
test_owner test_owner TRUNCATE test_owner
161+
test_owner test_owner UPDATE test_owner
162+
test_role1 test_owner DELETE test_owner
163+
test_role1 test_owner INSERT test_owner
164+
test_role1 test_owner SELECT test_owner
165+
test_role1 test_owner UPDATE test_owner
166+
cnt
167+
168+
10
169+
step s3_sw_3:
170+
select pg_switch_to_snapshot( ( select recent_snapshot from pg_control_snapshot() ) );
171+
select 'СМОТРЕТЬ НИЖЕ';
172+
173+
pg_switch_to_snapshot
174+
175+
176+
?column?
177+
178+
СМОТРЕТЬ НИЖЕ
179+
step s1_check:
180+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
181+
select count(*) as cnt from t1;
182+
183+
grantee grantor privilege_type tableowner
184+
185+
cnt
186+
187+
10
188+
189+
starting permutation: s3_mk_sn s1_g_1 s3_mk_sn s1_g_2 s3_mk_sn s3_rc_sn s1_check
190+
step s3_mk_sn:
191+
select 1 from pg_make_snapshot();
192+
193+
?column?
194+
195+
1
196+
step s1_g_1:
197+
grant select, insert, update, delete on t1 to test_role1;
198+
199+
step s3_mk_sn:
200+
select 1 from pg_make_snapshot();
201+
202+
?column?
203+
204+
1
205+
step s1_g_2:
206+
alter table t1 owner to test_role2;
207+
revoke all on t1 from test_role2;
208+
grant select, update, insert, delete on t1 to test_role2;
209+
210+
step s3_mk_sn:
211+
select 1 from pg_make_snapshot();
212+
213+
?column?
214+
215+
1
216+
step s3_rc_sn:
217+
select pg_recover_to_snapshot( ( select recent_snapshot from pg_control_snapshot() ) );
218+
219+
pg_recover_to_snapshot
220+
221+
222+
step s1_check:
223+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
224+
select count(*) as cnt from t1;
225+
226+
grantee grantor privilege_type tableowner
227+
228+
test_role1 test_role2 DELETE test_role2
229+
test_role1 test_role2 INSERT test_role2
230+
test_role1 test_role2 SELECT test_role2
231+
test_role1 test_role2 UPDATE test_role2
232+
test_role2 test_role2 DELETE test_role2
233+
test_role2 test_role2 INSERT test_role2
234+
test_role2 test_role2 SELECT test_role2
235+
test_role2 test_role2 UPDATE test_role2
236+
cnt
237+
238+
10
239+
240+
starting permutation: s3_mk_sn s1_check s1_g_1 s1_check s3_sw_3 s1_check
241+
step s3_mk_sn:
242+
select 1 from pg_make_snapshot();
243+
244+
?column?
245+
246+
1
247+
step s1_check:
248+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
249+
select count(*) as cnt from t1;
250+
251+
grantee grantor privilege_type tableowner
252+
253+
test_owner test_owner DELETE test_owner
254+
test_owner test_owner INSERT test_owner
255+
test_owner test_owner REFERENCES test_owner
256+
test_owner test_owner SELECT test_owner
257+
test_owner test_owner TRIGGER test_owner
258+
test_owner test_owner TRUNCATE test_owner
259+
test_owner test_owner UPDATE test_owner
260+
cnt
261+
262+
10
263+
step s1_g_1:
264+
grant select, insert, update, delete on t1 to test_role1;
265+
266+
step s1_check:
267+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
268+
select count(*) as cnt from t1;
269+
270+
grantee grantor privilege_type tableowner
271+
272+
test_owner test_owner DELETE test_owner
273+
test_owner test_owner INSERT test_owner
274+
test_owner test_owner REFERENCES test_owner
275+
test_owner test_owner SELECT test_owner
276+
test_owner test_owner TRIGGER test_owner
277+
test_owner test_owner TRUNCATE test_owner
278+
test_owner test_owner UPDATE test_owner
279+
test_role1 test_owner DELETE test_owner
280+
test_role1 test_owner INSERT test_owner
281+
test_role1 test_owner SELECT test_owner
282+
test_role1 test_owner UPDATE test_owner
283+
cnt
284+
285+
10
286+
step s3_sw_3:
287+
select pg_switch_to_snapshot( ( select recent_snapshot from pg_control_snapshot() ) );
288+
select 'СМОТРЕТЬ НИЖЕ';
289+
290+
pg_switch_to_snapshot
291+
292+
293+
?column?
294+
295+
СМОТРЕТЬ НИЖЕ
296+
step s1_check:
297+
SELECT grantee, grantor, privilege_type, ( select tableowner from pg_tables where ( table_schema || '.' || table_name ) = ( schemaname || '.' || tablename ) ) FROM information_schema.role_table_grants WHERE table_name = 't1' order by grantor, grantee, privilege_type;
298+
select count(*) as cnt from t1;
299+
300+
grantee grantor privilege_type tableowner
301+
302+
test_owner test_owner DELETE test_owner
303+
test_owner test_owner INSERT test_owner
304+
test_owner test_owner REFERENCES test_owner
305+
test_owner test_owner SELECT test_owner
306+
test_owner test_owner TRIGGER test_owner
307+
test_owner test_owner TRUNCATE test_owner
308+
test_owner test_owner UPDATE test_owner
309+
cnt
310+
311+
10

0 commit comments

Comments
 (0)