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

Commit53ebb22

Browse files
author
Hiroshi Inoue
committed
Change LockClassinfoForUpdate() to retry mark4update() in case
the tuple is already uodated. (If LockClassinfoForUpdate() isthought to be useful).
1 parent5322bf4 commit53ebb22

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

‎src/backend/catalog/index.c

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.133 2000/12/22 23:12:03 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.134 2001/01/18 04:01:42 inoue Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1348,15 +1348,26 @@ LockClassinfoForUpdate(Oid relid, HeapTuple rtup,
13481348
rtup->t_self=classTuple->t_self;
13491349
ReleaseSysCache(classTuple);
13501350

1351-
test=heap_mark4update(relationRelation,rtup,buffer);
1352-
switch (test)
1351+
while (1)
13531352
{
1354-
caseHeapTupleSelfUpdated:
1355-
caseHeapTupleMayBeUpdated:
1356-
break;
1357-
default:
1358-
elog(ERROR,"LockStatsForUpdate couldn't lock relid %u",relid);
1359-
return false;
1353+
ItemPointerDatatidsave;
1354+
1355+
ItemPointerCopy(&(rtup->t_self),&tidsave);
1356+
test=heap_mark4update(relationRelation,rtup,buffer);
1357+
switch (test)
1358+
{
1359+
caseHeapTupleSelfUpdated:
1360+
caseHeapTupleMayBeUpdated:
1361+
break;
1362+
caseHeapTupleUpdated:
1363+
ReleaseBuffer(*buffer);
1364+
if (!ItemPointerEquals(&(rtup->t_self),&tidsave))
1365+
continue;
1366+
default:
1367+
elog(ERROR,"LockClassinfoForUpdate couldn't lock relid %u",relid);
1368+
return false;
1369+
}
1370+
break;
13601371
}
13611372
RelationInvalidateHeapTuple(relationRelation,rtup);
13621373
if (confirmCommitted)
@@ -1634,8 +1645,7 @@ UpdateStats(Oid relid, long reltuples)
16341645
#ifdefOLD_FILE_NAMING
16351646
in_place_upd= (IsReindexProcessing()||IsBootstrapProcessingMode());
16361647
#else
1637-
in_place_upd= (IsIgnoringSystemIndexes()|| (IsReindexProcessing()&&
1638-
relid==RelOid_pg_class));
1648+
in_place_upd= (IsIgnoringSystemIndexes()||IsReindexProcessing());
16391649
#endif/* OLD_FILE_NAMING */
16401650

16411651
if (!in_place_upd)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp