Content-Length: 273449 | pFad | http://github.com/postgrespro/postgres_cluster/commit/c85a5352887979b29adb7c83e5c2171a08af8198

FA Fix bug in shmem initialization · postgrespro/postgres_cluster@c85a535 · GitHub
Skip to content

Commit c85a535

Browse files
committed
Fix bug in shmem initialization
1 parent 2d69b46 commit c85a535

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/raftable/state.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void state_shmem_request()
252252
info.entrysize = sizeof(RaftableEntry);
253253
info.dsize = info.max_dsize = hash_select_dirsize(RAFTABLE_HASH_SIZE);
254254
flags = HASH_SHARED_MEM | HASH_ALLOC | HASH_DIRSIZE | HASH_ELEM;
255-
RequestAddinShmemSpace(RAFTABLE_BLOCK_MEM + sizeof(State) + hash_get_shared_size(&info, flags));
255+
RequestAddinShmemSpace(RAFTABLE_BLOCK_MEM + BUFFERALIGN(sizeof(State)) + BUFFERALIGN(hash_get_shared_size(&info, flags)));
256256
RequestNamedLWLockTranche("raftable", 1);
257257
}
258258

@@ -267,7 +267,7 @@ StateP state_shmem_init()
267267

268268
state = ShmemInitStruct(
269269
"raftable_state",
270-
RAFTABLE_BLOCK_MEM,
270+
sizeof(State),
271271
&found
272272
);
273273
Assert(state);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/c85a5352887979b29adb7c83e5c2171a08af8198

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy