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

Commit002962d

Browse files
committed
Fix test_session_hooks with parallel workers
Several buildfarm machines have been complaining about the new moduletest_session_hooks to be unstable, like crake and thorntail. The issuewas that the module was trying to log some start and end sessionactivity for parallel workers, which makes little sense as they don'tsupport DML, so just prevent this pattern to happen in the module.This could be reproduced by enforcing force_parallel_mode=regress, whichis the value used by some of the buildfarm members.Discussion:https://postgr.es/m/20191001045246.GF2781@paquier.xyz
1 parente788bd9 commit002962d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/test/modules/test_session_hooks/test_session_hooks.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include"postgres.h"
1515

16+
#include"access/parallel.h"
1617
#include"access/xact.h"
1718
#include"commands/dbcommands.h"
1819
#include"executor/spi.h"
@@ -89,6 +90,10 @@ sample_session_start_hook(void)
8990
if (!OidIsValid(MyDatabaseId))
9091
return;
9192

93+
/* no parallel workers */
94+
if (IsParallelWorker())
95+
return;
96+
9297
register_session_hook("START");
9398
}
9499

@@ -107,6 +112,10 @@ sample_session_end_hook(void)
107112
if (!OidIsValid(MyDatabaseId))
108113
return;
109114

115+
/* no parallel workers */
116+
if (IsParallelWorker())
117+
return;
118+
110119
register_session_hook("END");
111120
}
112121

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp