Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit278aa68

Browse files
committed
Have to lock buffer while changing page' LSN.
Thanks to Tom.
1 parenta51d560 commit278aa68

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/commands/sequence.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.53 2001/04/03 21:58:00 vadim Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.54 2001/04/04 15:43:25 vadim Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -181,13 +181,13 @@ DefineSequence(CreateSeqStmt *seq)
181181
/* Now - form & insert sequence tuple */
182182
tuple=heap_formtuple(tupDesc,value,null);
183183
heap_insert(rel,tuple);
184-
ReleaseBuffer(buf);
185184

186185
/*
187186
* After crash REDO of heap_insert above would re-init page and
188187
* our magic number would be lost. We have to log sequence creation.
189188
* This means two log records instead of one -:(
190189
*/
190+
LockBuffer(buf,BUFFER_LOCK_EXCLUSIVE);
191191
START_CRIT_SECTION();
192192
{
193193
xl_seq_recxlrec;
@@ -217,6 +217,8 @@ DefineSequence(CreateSeqStmt *seq)
217217
}
218218
END_CRIT_SECTION();
219219

220+
LockBuffer(buf,BUFFER_LOCK_UNLOCK);
221+
ReleaseBuffer(buf);
220222
heap_close(rel,AccessExclusiveLock);
221223
}
222224

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp