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

Commit0222be1

Browse files
committed
Fix alignment problems with SharedInvalSmgrMsg.
SharedInvalSmgrMsg can't require 8-byte alignment, because thenSharedInvalidationMessage will require 8-byte alignment, which willthen cause ParseCommitRecord to fail on machines that are pickyabout alignment, because it assumes that everything that getspacked into a commit record requires only 4-byte alignment.Another problem with05d4cbf.Discussion:http://postgr.es/m/3825454.1664310917@sss.pgh.pa.us
1 parentd0b1dbc commit0222be1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

‎src/backend/utils/cache/inval.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,9 @@ LocalExecuteInvalidationMessage(SharedInvalidationMessage *msg)
663663
*/
664664
RelFileLocatorBackendrlocator;
665665

666-
rlocator.locator=msg->sm.rlocator;
666+
rlocator.locator.dbOid=msg->sm.dbOid;
667+
rlocator.locator.spcOid=msg->sm.spcOid;
668+
rlocator.locator.relNumber= (((uint64)msg->sm.relNumber_hi) <<32) |msg->sm.relNumber_lo;
667669
rlocator.backend= (msg->sm.backend_hi <<16) | (int)msg->sm.backend_lo;
668670
smgrcloserellocator(rlocator);
669671
}
@@ -1466,7 +1468,10 @@ CacheInvalidateSmgr(RelFileLocatorBackend rlocator)
14661468
msg.sm.id=SHAREDINVALSMGR_ID;
14671469
msg.sm.backend_hi=rlocator.backend >>16;
14681470
msg.sm.backend_lo=rlocator.backend&0xffff;
1469-
msg.sm.rlocator=rlocator.locator;
1471+
msg.sm.dbOid=rlocator.locator.dbOid;
1472+
msg.sm.spcOid=rlocator.locator.spcOid;
1473+
msg.sm.relNumber_hi=rlocator.locator.relNumber >>32;
1474+
msg.sm.relNumber_lo=rlocator.locator.relNumber&0xffffffff;
14701475
/* check AddCatcacheInvalidationMessage() for an explanation */
14711476
VALGRIND_MAKE_MEM_DEFINED(&msg,sizeof(msg));
14721477

‎src/include/storage/sinval.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ typedef struct
8686

8787
typedefstruct
8888
{
89-
/* note: field layout chosen to pack into16 bytes */
89+
/* note: field layout chosen to pack into20 bytes */
9090
int8id;/* type field --- must be first */
9191
int8backend_hi;/* high bits of backend ID, if temprel */
9292
uint16backend_lo;/* low bits of backend ID, if temprel */
93-
RelFileLocatorrlocator;/* spcOid, dbOid, relNumber */
93+
OiddbOid;
94+
OidspcOid;
95+
uint32relNumber_hi;/* avoid 8 byte alignment requirement */
96+
uint32relNumber_lo;
9497
}SharedInvalSmgrMsg;
9598

9699
#defineSHAREDINVALRELMAP_ID(-4)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp