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

Fix compatibility with new shm_mq_send API introduced in pg15.#39

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
keremet merged 1 commit intopostgrespro:masterfromrjuju:fix_send_shm_mq
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
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
12 changes: 7 additions & 5 deletionscollector.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -220,7 +220,7 @@ send_history(History *observations, shm_mq_handle *mqh)
else
count = observations->index;

mq_result =shm_mq_send(mqh, sizeof(count), &count, false);
mq_result =shm_mq_send_compat(mqh, sizeof(count), &count, false, true);
if (mq_result == SHM_MQ_DETACHED)
{
ereport(WARNING,
Expand All@@ -230,10 +230,11 @@ send_history(History *observations, shm_mq_handle *mqh)
}
for (i = 0; i < count; i++)
{
mq_result =shm_mq_send(mqh,
mq_result =shm_mq_send_compat(mqh,
sizeof(HistoryItem),
&observations->items[i],
false);
false,
true);
if (mq_result == SHM_MQ_DETACHED)
{
ereport(WARNING,
Expand All@@ -255,7 +256,7 @@ send_profile(HTAB *profile_hash, shm_mq_handle *mqh)
Sizecount = hash_get_num_entries(profile_hash);
shm_mq_resultmq_result;

mq_result =shm_mq_send(mqh, sizeof(count), &count, false);
mq_result =shm_mq_send_compat(mqh, sizeof(count), &count, false, true);
if (mq_result == SHM_MQ_DETACHED)
{
ereport(WARNING,
Expand All@@ -266,7 +267,8 @@ send_profile(HTAB *profile_hash, shm_mq_handle *mqh)
hash_seq_init(&scan_status, profile_hash);
while ((item = (ProfileItem *) hash_seq_search(&scan_status)) != NULL)
{
mq_result = shm_mq_send(mqh, sizeof(ProfileItem), item, false);
mq_result = shm_mq_send_compat(mqh, sizeof(ProfileItem), item, false,
true);
if (mq_result == SHM_MQ_DETACHED)
{
hash_seq_term(&scan_status);
Expand Down
11 changes: 11 additions & 0 deletionscompat.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,17 @@ shm_mq_detach_compat(shm_mq_handle *mqh, shm_mq *mq)
#endif
}

inline shm_mq_result
shm_mq_send_compat(shm_mq_handle *mqh, Size nbytes, const void *data,
bool nowait, bool force_flush)
{
#if PG_VERSION_NUM >= 150000
return shm_mq_send(mqh, nbytes, data, nowait, force_flush);
#else
return shm_mq_send(mqh, nbytes, data, nowait);
#endif
}

inline TupleDesc
CreateTemplateTupleDescCompat(int nattrs, bool hasoid)
{
Expand Down
3 changes: 3 additions & 0 deletionspg_wait_sampling.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,9 @@ extern void alloc_history(History *, int);
extern void collector_main(Datum main_arg);

extern void shm_mq_detach_compat(shm_mq_handle *mqh, shm_mq *mq);
extern shm_mq_result shm_mq_send_compat(shm_mq_handle *mqh, Size nbytes,
const void *data, bool nowait,
bool force_flush);
extern TupleDesc CreateTemplateTupleDescCompat(int nattrs, bool hasoid);

#endif

[8]ページ先頭

©2009-2025 Movatter.jp