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
3fea625e
Commit
3fea625e
authored
Sep 28, 1999
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make tree compilable (+WAL).
parent
539b6304
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
26 deletions
+29
-26
src/backend/access/transam/xact.c
src/backend/access/transam/xact.c
+3
-3
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+3
-4
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+6
-8
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/bufmgr.c
+4
-7
src/backend/storage/smgr/md.c
src/backend/storage/smgr/md.c
+8
-1
src/backend/utils/init/postinit.c
src/backend/utils/init/postinit.c
+3
-1
src/include/storage/bufmgr.h
src/include/storage/bufmgr.h
+2
-2
No files found.
src/backend/access/transam/xact.c
View file @
3fea625e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.5
3 1999/09/24 00:24:05 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.5
4 1999/09/28 11:41:03 vadim
Exp $
*
*
* NOTES
* NOTES
* Transaction aborts can now occur two ways:
* Transaction aborts can now occur two ways:
...
@@ -632,7 +632,7 @@ RecordTransactionCommit()
...
@@ -632,7 +632,7 @@ RecordTransactionCommit()
*/
*/
if
(
SharedBufferChanged
)
if
(
SharedBufferChanged
)
{
{
FlushBufferPool
(
!
TransactionFlushEnabled
()
);
FlushBufferPool
();
if
(
leak
)
if
(
leak
)
ResetBufferPool
();
ResetBufferPool
();
...
@@ -646,7 +646,7 @@ RecordTransactionCommit()
...
@@ -646,7 +646,7 @@ RecordTransactionCommit()
* Now write the log info to the disk too.
* Now write the log info to the disk too.
*/
*/
leak
=
BufferPoolCheckLeak
();
leak
=
BufferPoolCheckLeak
();
FlushBufferPool
(
!
TransactionFlushEnabled
()
);
FlushBufferPool
();
}
}
if
(
leak
)
if
(
leak
)
...
...
src/backend/access/transam/xlog.c
View file @
3fea625e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#include <unistd.h>
#include <unistd.h>
#include <errno.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "postgres.h"
#include "postgres.h"
#include "access/xlog.h"
#include "access/xlog.h"
...
@@ -1376,12 +1377,10 @@ CreateCheckPoint(bool shutdown)
...
@@ -1376,12 +1377,10 @@ CreateCheckPoint(bool shutdown)
/* Get REDO record ptr */
/* Get REDO record ptr */
while
(
!
TAS
(
&
(
XLogCtl
->
insert_lck
)))
while
(
!
TAS
(
&
(
XLogCtl
->
insert_lck
)))
{
{
struct
timeval
delay
;
struct
timeval
delay
=
{
0
,
5000
}
;
if
(
shutdown
)
if
(
shutdown
)
elog
(
STOP
,
"XLog insert lock is busy while data base is shutting down"
);
elog
(
STOP
,
"XLog insert lock is busy while data base is shutting down"
);
delay
.
tv_sec
=
0
;
delay
.
tv_usec
=
0
;
(
void
)
select
(
0
,
NULL
,
NULL
,
NULL
,
&
delay
);
(
void
)
select
(
0
,
NULL
,
NULL
,
NULL
,
&
delay
);
}
}
freespace
=
((
char
*
)
Insert
->
currpage
)
+
BLCKSZ
-
Insert
->
currpos
;
freespace
=
((
char
*
)
Insert
->
currpage
)
+
BLCKSZ
-
Insert
->
currpos
;
...
@@ -1408,7 +1407,7 @@ CreateCheckPoint(bool shutdown)
...
@@ -1408,7 +1407,7 @@ CreateCheckPoint(bool shutdown)
checkPoint
.
nextOid
=
ShmemVariableCache
->
nextOid
;
checkPoint
.
nextOid
=
ShmemVariableCache
->
nextOid
;
SpinRelease
(
OidGenLockId
);
SpinRelease
(
OidGenLockId
);
FlushBufferPool
(
false
);
FlushBufferPool
();
/* Get UNDO record ptr */
/* Get UNDO record ptr */
...
...
src/backend/commands/vacuum.c
View file @
3fea625e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.12
1 1999/09/24 00:24:17 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.12
2 1999/09/28 11:41:04 vadim
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1703,9 +1703,9 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
...
@@ -1703,9 +1703,9 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
* flush buffers and record status of current transaction as
* flush buffers and record status of current transaction as
* committed, and continue. - vadim 11/13/96
* committed, and continue. - vadim 11/13/96
*/
*/
FlushBufferPool
(
!
TransactionFlushEnabled
()
);
FlushBufferPool
();
TransactionIdCommit
(
myXID
);
TransactionIdCommit
(
myXID
);
FlushBufferPool
(
!
TransactionFlushEnabled
()
);
FlushBufferPool
();
}
}
/*
/*
...
@@ -1899,12 +1899,10 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages)
...
@@ -1899,12 +1899,10 @@ vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vacuum_pages)
vacrelstats
->
num_pages
,
nblocks
);
vacrelstats
->
num_pages
,
nblocks
);
/*
/*
* we have to flush "empty" end-pages (if changed, but who knows
* We have to flush "empty" end-pages (if changed, but who knows it)
* it) before truncation
* before truncation
*
* XXX wouldn't passing 'true' to FlushRelationBuffers do the job?
*/
*/
FlushBufferPool
(
!
TransactionFlushEnabled
()
);
FlushBufferPool
();
i
=
FlushRelationBuffers
(
onerel
,
nblocks
,
false
);
i
=
FlushRelationBuffers
(
onerel
,
nblocks
,
false
);
if
(
i
<
0
)
if
(
i
<
0
)
...
...
src/backend/storage/buffer/bufmgr.c
View file @
3fea625e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.6
3 1999/09/24 00:24:29 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.6
4 1999/09/28 11:41:06 vadim
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1240,13 +1240,10 @@ relname=%s, blockNum=%d, flags=0x%x, refcount=%d %d)",
...
@@ -1240,13 +1240,10 @@ relname=%s, blockNum=%d, flags=0x%x, refcount=%d %d)",
* ------------------------------------------------
* ------------------------------------------------
*/
*/
void
void
FlushBufferPool
(
int
StableMainMemoryFlag
)
FlushBufferPool
(
void
)
{
{
if
(
!
StableMainMemoryFlag
)
BufferSync
();
{
smgrcommit
();
BufferSync
();
smgrcommit
();
}
}
}
/*
/*
...
...
src/backend/storage/smgr/md.c
View file @
3fea625e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.5
4 1999/09/24 00:24:47 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.5
5 1999/09/28 11:41:07 vadim
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -815,6 +815,12 @@ mdtruncate(Relation reln, int nblocks)
...
@@ -815,6 +815,12 @@ mdtruncate(Relation reln, int nblocks)
int
int
mdcommit
()
mdcommit
()
{
{
#ifdef XLOG
sync
();
sleep
(
1
);
sync
();
return
SM_SUCCESS
;
#else
int
i
;
int
i
;
MdfdVec
*
v
;
MdfdVec
*
v
;
...
@@ -838,6 +844,7 @@ mdcommit()
...
@@ -838,6 +844,7 @@ mdcommit()
}
}
return
SM_SUCCESS
;
return
SM_SUCCESS
;
#endif
/* XLOG */
}
}
/*
/*
...
...
src/backend/utils/init/postinit.c
View file @
3fea625e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.
49 1999/09/24 00:24:58 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.
50 1999/09/28 11:41:09 vadim
Exp $
*
*
* NOTES
* NOTES
* InitPostgres() is the function called from PostgresMain
* InitPostgres() is the function called from PostgresMain
...
@@ -541,8 +541,10 @@ InitPostgres(char *name) /* database name */
...
@@ -541,8 +541,10 @@ InitPostgres(char *name) /* database name */
*/
*/
InitLocalBuffer
();
InitLocalBuffer
();
#ifndef XLOG
if
(
!
TransactionFlushEnabled
())
if
(
!
TransactionFlushEnabled
())
on_shmem_exit
(
FlushBufferPool
,
(
caddr_t
)
NULL
);
on_shmem_exit
(
FlushBufferPool
,
(
caddr_t
)
NULL
);
#endif
/* ----------------
/* ----------------
* initialize the database id used for system caches and lock tables
* initialize the database id used for system caches and lock tables
...
...
src/include/storage/bufmgr.h
View file @
3fea625e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: bufmgr.h,v 1.3
1 1999/09/24 00:25:27 tgl
Exp $
* $Id: bufmgr.h,v 1.3
2 1999/09/28 11:40:53 vadim
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -170,7 +170,7 @@ extern void PrintBufferUsage(FILE *statfp);
...
@@ -170,7 +170,7 @@ extern void PrintBufferUsage(FILE *statfp);
extern
void
ResetBufferUsage
(
void
);
extern
void
ResetBufferUsage
(
void
);
extern
void
ResetBufferPool
(
void
);
extern
void
ResetBufferPool
(
void
);
extern
int
BufferPoolCheckLeak
(
void
);
extern
int
BufferPoolCheckLeak
(
void
);
extern
void
FlushBufferPool
(
int
StableMainMemoryFlag
);
extern
void
FlushBufferPool
(
void
);
extern
BlockNumber
BufferGetBlockNumber
(
Buffer
buffer
);
extern
BlockNumber
BufferGetBlockNumber
(
Buffer
buffer
);
extern
BlockNumber
RelationGetNumberOfBlocks
(
Relation
relation
);
extern
BlockNumber
RelationGetNumberOfBlocks
(
Relation
relation
);
extern
int
FlushRelationBuffers
(
Relation
rel
,
BlockNumber
block
,
extern
int
FlushRelationBuffers
(
Relation
rel
,
BlockNumber
block
,
...
...
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