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
53502161
Commit
53502161
authored
Jul 01, 2005
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error messages and add comment
parent
555f5139
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
src/backend/access/gist/gistxlog.c
src/backend/access/gist/gistxlog.c
+14
-5
No files found.
src/backend/access/gist/gistxlog.c
View file @
53502161
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.
6 2005/06/30 17:52:14
teodor Exp $
* $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.
7 2005/07/01 13:18:17
teodor Exp $
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include "postgres.h"
#include "postgres.h"
...
@@ -162,7 +162,7 @@ gistRedoEntryUpdateRecord(XLogRecPtr lsn, XLogRecord *record, bool isnewroot) {
...
@@ -162,7 +162,7 @@ gistRedoEntryUpdateRecord(XLogRecPtr lsn, XLogRecord *record, bool isnewroot) {
return
;
return
;
buffer
=
XLogReadBuffer
(
false
,
reln
,
xlrec
.
data
->
blkno
);
buffer
=
XLogReadBuffer
(
false
,
reln
,
xlrec
.
data
->
blkno
);
if
(
!
BufferIsValid
(
buffer
))
if
(
!
BufferIsValid
(
buffer
))
elog
(
PANIC
,
"gistRedoEntryUpdateRecord: block
unfound"
);
elog
(
PANIC
,
"gistRedoEntryUpdateRecord: block
%u unfound"
,
xlrec
.
data
->
blkno
);
page
=
(
Page
)
BufferGetPage
(
buffer
);
page
=
(
Page
)
BufferGetPage
(
buffer
);
if
(
isnewroot
)
{
if
(
isnewroot
)
{
...
@@ -173,7 +173,7 @@ gistRedoEntryUpdateRecord(XLogRecPtr lsn, XLogRecord *record, bool isnewroot) {
...
@@ -173,7 +173,7 @@ gistRedoEntryUpdateRecord(XLogRecPtr lsn, XLogRecord *record, bool isnewroot) {
}
}
}
else
{
}
else
{
if
(
PageIsNew
((
PageHeader
)
page
)
)
if
(
PageIsNew
((
PageHeader
)
page
)
)
elog
(
PANIC
,
"gistRedoEntryUpdateRecord: uninitialized page
"
);
elog
(
PANIC
,
"gistRedoEntryUpdateRecord: uninitialized page
blkno %u"
,
xlrec
.
data
->
blkno
);
if
(
XLByteLE
(
lsn
,
PageGetLSN
(
page
)))
{
if
(
XLByteLE
(
lsn
,
PageGetLSN
(
page
)))
{
LockBuffer
(
buffer
,
BUFFER_LOCK_UNLOCK
);
LockBuffer
(
buffer
,
BUFFER_LOCK_UNLOCK
);
ReleaseBuffer
(
buffer
);
ReleaseBuffer
(
buffer
);
...
@@ -476,7 +476,7 @@ gistXLogReadAndLockBuffer( Relation r, BlockNumber blkno ) {
...
@@ -476,7 +476,7 @@ gistXLogReadAndLockBuffer( Relation r, BlockNumber blkno ) {
if
(
!
BufferIsValid
(
buffer
))
if
(
!
BufferIsValid
(
buffer
))
elog
(
PANIC
,
"gistXLogReadAndLockBuffer: block %u unfound"
,
blkno
);
elog
(
PANIC
,
"gistXLogReadAndLockBuffer: block %u unfound"
,
blkno
);
if
(
PageIsNew
(
(
PageHeader
)(
BufferGetPage
(
buffer
))
)
)
if
(
PageIsNew
(
(
PageHeader
)(
BufferGetPage
(
buffer
))
)
)
elog
(
PANIC
,
"gistXLogReadAndLockBuffer: uninitialized page %u"
,
blkno
);
elog
(
PANIC
,
"gistXLogReadAndLockBuffer: uninitialized page
blkno
%u"
,
blkno
);
return
buffer
;
return
buffer
;
}
}
...
@@ -510,6 +510,15 @@ gixtxlogFindPath( Relation index, gistIncompleteInsert *insert ) {
...
@@ -510,6 +510,15 @@ gixtxlogFindPath( Relation index, gistIncompleteInsert *insert ) {
elog
(
LOG
,
"gixtxlogFindPath: lost parent for block %u"
,
insert
->
origblkno
);
elog
(
LOG
,
"gixtxlogFindPath: lost parent for block %u"
,
insert
->
origblkno
);
}
}
/*
* Continue insert after crash. In normal situation, there isn't any incomplete
* inserts, but if it might be after crash, WAL may has not a record of completetion.
*
* Although stored LSN in gistIncompleteInsert is a LSN of child page,
* we can compare it with LSN of parent, because parent is always locked
* while we change child page (look at gistmakedeal). So if parent's LSN is
* lesser than stored lsn then changes in parent doesn't do yet.
*/
static
void
static
void
gistContinueInsert
(
gistIncompleteInsert
*
insert
)
{
gistContinueInsert
(
gistIncompleteInsert
*
insert
)
{
IndexTuple
*
itup
;
IndexTuple
*
itup
;
...
@@ -574,7 +583,7 @@ gistContinueInsert(gistIncompleteInsert *insert) {
...
@@ -574,7 +583,7 @@ gistContinueInsert(gistIncompleteInsert *insert) {
elog
(
PANIC
,
"gistContinueInsert: block %u unfound"
,
insert
->
path
[
i
]);
elog
(
PANIC
,
"gistContinueInsert: block %u unfound"
,
insert
->
path
[
i
]);
pages
[
numbuffer
-
1
]
=
BufferGetPage
(
buffers
[
numbuffer
-
1
]
);
pages
[
numbuffer
-
1
]
=
BufferGetPage
(
buffers
[
numbuffer
-
1
]
);
if
(
PageIsNew
((
PageHeader
)(
pages
[
numbuffer
-
1
]))
)
if
(
PageIsNew
((
PageHeader
)(
pages
[
numbuffer
-
1
]))
)
elog
(
PANIC
,
"gistContinueInsert: uninitialized page
"
);
elog
(
PANIC
,
"gistContinueInsert: uninitialized page
blkno %u"
,
insert
->
path
[
i
]
);
if
(
XLByteLE
(
insert
->
lsn
,
PageGetLSN
(
pages
[
numbuffer
-
1
])))
{
if
(
XLByteLE
(
insert
->
lsn
,
PageGetLSN
(
pages
[
numbuffer
-
1
])))
{
LockBuffer
(
buffers
[
numbuffer
-
1
],
BUFFER_LOCK_UNLOCK
);
LockBuffer
(
buffers
[
numbuffer
-
1
],
BUFFER_LOCK_UNLOCK
);
...
...
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