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
ff5a354e
Commit
ff5a354e
authored
Dec 17, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix is-it-time-for-a-checkpoint logic so that checkpoint_segments can
usefully be larger than 255. Per gripe from Simon Riggs.
parent
24658a2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+26
-9
No files found.
src/backend/access/transam/xlog.c
View file @
ff5a354e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.17
8 2004/11/17 16:26:59
tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.17
9 2004/12/17 00:10:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1201,21 +1201,38 @@ XLogWrite(XLogwrtRqst WriteRqst)
...
@@ -1201,21 +1201,38 @@ XLogWrite(XLogwrtRqst WriteRqst)
UpdateControlFile
();
UpdateControlFile
();
/*
/*
* Signal
postmas
ter to start a checkpoint if it's been
* Signal
bgwri
ter to start a checkpoint if it's been
* too long since the last one. (We look at local copy of
* too long since the last one. (We look at local copy of
* RedoRecPtr which might be a little out of date, but
* RedoRecPtr which might be a little out of date, but
* should be close enough for this purpose.)
* should be close enough for this purpose.)
*
* A straight computation of segment number could overflow
* 32 bits. Rather than assuming we have working 64-bit
* arithmetic, we compare the highest-order bits separately,
* and force a checkpoint immediately when they change.
*/
*/
if
(
IsUnderPostmaster
&&
if
(
IsUnderPostmaster
)
(
openLogId
!=
RedoRecPtr
.
xlogid
||
openLogSeg
>=
(
RedoRecPtr
.
xrecoff
/
XLogSegSize
)
+
(
uint32
)
CheckPointSegments
))
{
{
uint32
old_segno
,
new_segno
;
uint32
old_highbits
,
new_highbits
;
old_segno
=
(
RedoRecPtr
.
xlogid
%
XLogSegSize
)
*
XLogSegsPerFile
+
(
RedoRecPtr
.
xrecoff
/
XLogSegSize
);
old_highbits
=
RedoRecPtr
.
xlogid
/
XLogSegSize
;
new_segno
=
(
openLogId
%
XLogSegSize
)
*
XLogSegsPerFile
+
openLogSeg
;
new_highbits
=
openLogId
/
XLogSegSize
;
if
(
new_highbits
!=
old_highbits
||
new_segno
>=
old_segno
+
(
uint32
)
CheckPointSegments
)
{
#ifdef WAL_DEBUG
#ifdef WAL_DEBUG
if
(
XLOG_DEBUG
)
if
(
XLOG_DEBUG
)
elog
(
LOG
,
"time for a checkpoint, signaling bgwriter"
);
elog
(
LOG
,
"time for a checkpoint, signaling bgwriter"
);
#endif
#endif
RequestCheckpoint
(
false
);
RequestCheckpoint
(
false
);
}
}
}
}
}
LWLockRelease
(
ControlFileLock
);
LWLockRelease
(
ControlFileLock
);
...
...
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