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
7d363c4c
Commit
7d363c4c
authored
Dec 29, 2000
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUST update (in-memory) data page BEFORE XLogInsert to log
NEW page content if WAL will decide to backup page.
parent
b05b9819
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtinsert.c
+12
-13
src/backend/access/nbtree/nbtpage.c
src/backend/access/nbtree/nbtpage.c
+3
-4
No files found.
src/backend/access/nbtree/nbtinsert.c
View file @
7d363c4c
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.7
1 2000/12/28 13:00:07
vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.7
2 2000/12/29 20:47:16
vadim Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -518,12 +518,17 @@ _bt_insertonpg(Relation rel,
}
else
{
START_CRIT_CODE
;
_bt_pgaddtup
(
rel
,
page
,
itemsz
,
btitem
,
newitemoff
,
"page"
);
itup_off
=
newitemoff
;
itup_blkno
=
BufferGetBlockNumber
(
buf
);
/* XLOG stuff */
{
xl_btree_insert
xlrec
;
uint8
flag
=
XLOG_BTREE_INSERT
;
XLogRecPtr
recptr
;
XLogRecData
rdata
[
2
];
BTItemData
truncitem
;
xlrec
.
target
.
node
=
rel
->
rd_node
;
ItemPointerSet
(
&
(
xlrec
.
target
.
tid
),
BufferGetBlockNumber
(
buf
),
newitemoff
);
...
...
@@ -535,8 +540,7 @@ _bt_insertonpg(Relation rel,
/* Read comments in _bt_pgaddtup */
if
(
!
(
P_ISLEAF
(
lpageop
))
&&
newitemoff
==
P_FIRSTDATAKEY
(
lpageop
))
{
BTItemData
truncitem
=
*
btitem
;
truncitem
=
*
btitem
;
truncitem
.
bti_itup
.
t_info
=
sizeof
(
BTItemData
);
rdata
[
1
].
data
=
(
char
*
)
&
truncitem
;
rdata
[
1
].
len
=
sizeof
(
BTItemData
);
...
...
@@ -559,9 +563,7 @@ _bt_insertonpg(Relation rel,
PageSetSUI
(
page
,
ThisStartUpID
);
}
_bt_pgaddtup
(
rel
,
page
,
itemsz
,
btitem
,
newitemoff
,
"page"
);
itup_off
=
newitemoff
;
itup_blkno
=
BufferGetBlockNumber
(
buf
);
END_CRIT_CODE
;
/* Write out the updated page and release pin/lock */
_bt_wrtbuf
(
rel
,
buf
);
}
...
...
@@ -600,7 +602,6 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
oopaque
;
Buffer
sbuf
=
0
;
Page
spage
=
0
;
BTPageOpaque
sopaque
;
Size
itemsz
;
ItemId
itemid
;
BTItem
item
;
...
...
@@ -821,6 +822,9 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
if
(
!
P_RIGHTMOST
(
ropaque
))
{
BTPageOpaque
sopaque
=
(
BTPageOpaque
)
PageGetSpecialPointer
(
spage
);
sopaque
->
btpo_prev
=
BufferGetBlockNumber
(
rbuf
);
rdata
[
2
].
next
=
&
(
rdata
[
3
]);
rdata
[
3
].
buffer
=
sbuf
;
rdata
[
3
].
data
=
NULL
;
...
...
@@ -856,14 +860,9 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
PageRestoreTempPage
(
leftpage
,
origpage
);
/* write and release the old right sibling */
if
(
!
P_RIGHTMOST
(
ropaque
))
{
sopaque
=
(
BTPageOpaque
)
PageGetSpecialPointer
(
spage
);
sopaque
->
btpo_prev
=
BufferGetBlockNumber
(
rbuf
);
/* write and release the old right sibling */
_bt_wrtbuf
(
rel
,
sbuf
);
}
END_CRIT_CODE
;
/* split's done */
...
...
src/backend/access/nbtree/nbtpage.c
View file @
7d363c4c
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.4
4 2000/12/28 13:00:0
7 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.4
5 2000/12/29 20:47:1
7 vadim Exp $
*
* NOTES
* Postgres btree pages look like ordinary relation pages. The opaque
...
...
@@ -410,8 +410,9 @@ _bt_pagedel(Relation rel, ItemPointer tid)
buf
=
_bt_getbuf
(
rel
,
blkno
,
BT_WRITE
);
page
=
BufferGetPage
(
buf
);
/* XLOG stuff */
START_CRIT_CODE
;
PageIndexTupleDelete
(
page
,
offno
);
/* XLOG stuff */
{
xl_btree_delete
xlrec
;
XLogRecPtr
recptr
;
...
...
@@ -434,8 +435,6 @@ _bt_pagedel(Relation rel, ItemPointer tid)
PageSetLSN
(
page
,
recptr
);
PageSetSUI
(
page
,
ThisStartUpID
);
}
PageIndexTupleDelete
(
page
,
offno
);
END_CRIT_CODE
;
/* write the buffer and release the lock */
...
...
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