Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allocate shared memory for wal_redo process #165

Merged
merged 2 commits into from
Jun 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/backend/port/sysv_shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size)
}
}
#endif
if (am_wal_redo_postgres)
return valloc(size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to look up what valloc is, never heard of that before :-).

Why not malloc?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valloc returns address aligned on page boundary. It may affect alignment of some Postgres data structures. Not sure that it is critical for wal redo. But I thought that it will be better to preserve alignement.


shmid = shmget(memKey, size, IPC_CREAT | IPC_EXCL | IPCProtection);

Expand Down