Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
eace269b
Commit
eace269b
authored
Apr 06, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair assert failure in tuple-chain-moving logic (introduced by yours
truly, I'm afraid).
parent
7c6bac00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+26
-10
No files found.
src/backend/commands/vacuum.c
View file @
eace269b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.14
4 2000/03/17 02:36:06
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.14
5 2000/04/06 00:29:51
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1510,6 +1510,8 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
...
@@ -1510,6 +1510,8 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
ItemPointerSetInvalid
(
&
Ctid
);
ItemPointerSetInvalid
(
&
Ctid
);
for
(
ti
=
0
;
ti
<
num_vtmove
;
ti
++
)
for
(
ti
=
0
;
ti
<
num_vtmove
;
ti
++
)
{
{
VPageDescr
destvpd
=
vtmove
[
ti
].
vpd
;
/* Get tuple from chain */
/* Get tuple from chain */
tuple
.
t_self
=
vtmove
[
ti
].
tid
;
tuple
.
t_self
=
vtmove
[
ti
].
tid
;
Cbuf
=
ReadBuffer
(
onerel
,
Cbuf
=
ReadBuffer
(
onerel
,
...
@@ -1521,7 +1523,7 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
...
@@ -1521,7 +1523,7 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Cpage
,
Citemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Cpage
,
Citemid
);
tuple_len
=
tuple
.
t_len
=
ItemIdGetLength
(
Citemid
);
tuple_len
=
tuple
.
t_len
=
ItemIdGetLength
(
Citemid
);
/* Get page to move in */
/* Get page to move in */
cur_buffer
=
ReadBuffer
(
onerel
,
vtmove
[
ti
].
vpd
->
vpd_blkno
);
cur_buffer
=
ReadBuffer
(
onerel
,
dest
vpd
->
vpd_blkno
);
/*
/*
* We should LockBuffer(cur_buffer) but don't, at the
* We should LockBuffer(cur_buffer) but don't, at the
...
@@ -1530,9 +1532,24 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
...
@@ -1530,9 +1532,24 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
* to get t_infomask of inserted heap tuple !!!
* to get t_infomask of inserted heap tuple !!!
*/
*/
ToPage
=
BufferGetPage
(
cur_buffer
);
ToPage
=
BufferGetPage
(
cur_buffer
);
/* if this page was not used before - clean it */
/*
* If this page was not used before - clean it.
*
* This path is different from the other callers of
* vc_vacpage, because we have already incremented the
* vpd's vpd_offsets_used field to account for the
* tuple(s) we expect to move onto the page. Therefore
* vc_vacpage's check for vpd_offsets_used == 0 is wrong.
* But since that's a good debugging check for all other
* callers, we work around it here rather than remove it.
*/
if
(
!
PageIsEmpty
(
ToPage
)
&&
vtmove
[
ti
].
cleanVpd
)
if
(
!
PageIsEmpty
(
ToPage
)
&&
vtmove
[
ti
].
cleanVpd
)
vc_vacpage
(
ToPage
,
vtmove
[
ti
].
vpd
);
{
int
sv_offsets_used
=
destvpd
->
vpd_offsets_used
;
destvpd
->
vpd_offsets_used
=
0
;
vc_vacpage
(
ToPage
,
destvpd
);
destvpd
->
vpd_offsets_used
=
sv_offsets_used
;
}
heap_copytuple_with_tuple
(
&
tuple
,
&
newtup
);
heap_copytuple_with_tuple
(
&
tuple
,
&
newtup
);
RelationInvalidateHeapTuple
(
onerel
,
&
tuple
);
RelationInvalidateHeapTuple
(
onerel
,
&
tuple
);
TransactionIdStore
(
myXID
,
(
TransactionId
*
)
&
(
newtup
.
t_data
->
t_cmin
));
TransactionIdStore
(
myXID
,
(
TransactionId
*
)
&
(
newtup
.
t_data
->
t_cmin
));
...
@@ -1543,17 +1560,16 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
...
@@ -1543,17 +1560,16 @@ vc_repair_frag(VRelStats *vacrelstats, Relation onerel,
InvalidOffsetNumber
,
LP_USED
);
InvalidOffsetNumber
,
LP_USED
);
if
(
newoff
==
InvalidOffsetNumber
)
if
(
newoff
==
InvalidOffsetNumber
)
{
{
elog
(
ERROR
,
"\
elog
(
ERROR
,
"moving chain: failed to add item with len = %u to page %u"
,
moving chain: failed to add item with len = %u to page %u"
,
tuple_len
,
destvpd
->
vpd_blkno
);
tuple_len
,
vtmove
[
ti
].
vpd
->
vpd_blkno
);
}
}
newitemid
=
PageGetItemId
(
ToPage
,
newoff
);
newitemid
=
PageGetItemId
(
ToPage
,
newoff
);
pfree
(
newtup
.
t_data
);
pfree
(
newtup
.
t_data
);
newtup
.
t_datamcxt
=
NULL
;
newtup
.
t_datamcxt
=
NULL
;
newtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
ToPage
,
newitemid
);
newtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
ToPage
,
newitemid
);
ItemPointerSet
(
&
(
newtup
.
t_self
),
vtmove
[
ti
].
vpd
->
vpd_blkno
,
newoff
);
ItemPointerSet
(
&
(
newtup
.
t_self
),
dest
vpd
->
vpd_blkno
,
newoff
);
if
(((
int
)
vtmove
[
ti
].
vpd
->
vpd_blkno
)
>
last_move_dest_block
)
if
(((
int
)
dest
vpd
->
vpd_blkno
)
>
last_move_dest_block
)
last_move_dest_block
=
vtmove
[
ti
].
vpd
->
vpd_blkno
;
last_move_dest_block
=
dest
vpd
->
vpd_blkno
;
/*
/*
* Set t_ctid pointing to itself for last tuple in
* Set t_ctid pointing to itself for last tuple in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment