Skip to content

Commit 8da61ff

Browse files
committed
f
1 parent 5cd8e6b commit 8da61ff

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4501,8 +4501,9 @@ BackendStartup(Port *port)
45014501
pid = backend_forkexec(port);
45024502
#else /* !EXEC_BACKEND */
45034503

4504-
if (gp_enable_fork_lock)
4505-
SpinLockAcquire(ForkLock);
4504+
if (gp_enable_fork_sleep)
4505+
pg_usleep(gp_enable_fork_sleep * 1000 /*ms*/);
4506+
45064507
pid = fork_process();
45074508
if (pid == 0) /* child */
45084509
{
@@ -4527,8 +4528,6 @@ BackendStartup(Port *port)
45274528

45284529
/* Perform additional initialization and collect startup packet */
45294530
BackendInitialize(port);
4530-
if (gp_enable_fork_lock)
4531-
SpinLockRelease(ForkLock);
45324531

45334532
/* And run the backend */
45344533
BackendRun(port);

src/backend/storage/ipc/ipci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ CreateSharedMemoryAndSemaphores(int port)
372372

373373
if (gp_enable_resqueue_priority)
374374
BackoffStateInit();
375-
if (gp_enable_fork_lock) {
375+
if (gp_enable_fork_sleep) {
376376
/* Create ProcStructLock spinlock, too */
377377
ForkLock = (slock_t *) ShmemAlloc(sizeof(slock_t));
378378
SpinLockInit(ForkLock);

src/backend/utils/misc/guc_gp.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static char *gp_resource_manager_str;
215215

216216
/* Backoff-related GUCs */
217217
bool gp_enable_resqueue_priority;
218-
bool gp_enable_fork_lock;
218+
int gp_enable_fork_sleep;
219219
int gp_resqueue_priority_local_interval;
220220
int gp_resqueue_priority_sweeper_interval;
221221
int gp_resqueue_priority_inactivity_timeout;
@@ -1744,17 +1744,6 @@ struct config_bool ConfigureNamesBool_gp[] =
17441744
true,
17451745
NULL, NULL, NULL
17461746
},
1747-
1748-
{
1749-
{"gp_enable_fork_lock", PGC_POSTMASTER, RESOURCES_MGM,
1750-
gettext_noop("Enables priority scheduling."),
1751-
NULL
1752-
},
1753-
&gp_enable_fork_lock,
1754-
true,
1755-
NULL, NULL, NULL
1756-
},
1757-
17581747
{
17591748
{"debug_resource_group", PGC_USERSET, DEVELOPER_OPTIONS,
17601749
gettext_noop("Prints resource groups debug logs."),
@@ -3350,6 +3339,19 @@ struct config_bool ConfigureNamesBool_gp[] =
33503339

33513340
struct config_int ConfigureNamesInt_gp[] =
33523341
{
3342+
3343+
{
3344+
{"gp_enable_fork_sleep", PGC_USERSET, RESOURCES_MGM,
3345+
gettext_noop("Enables priority scheduling."),
3346+
gettext_noop("Enables priority scheduling."),
3347+
GUC_UNIT_S | GUC_NOT_IN_SAMPLE
3348+
},
3349+
&gp_enable_fork_sleep,
3350+
100, 0, 7200,
3351+
NULL, NULL, NULL
3352+
},
3353+
3354+
33533355
{
33543356
{"readable_external_table_timeout", PGC_USERSET, EXTERNAL_TABLES,
33553357
gettext_noop("Cancel the query if no data read within N seconds."),

src/include/postmaster/backoff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/* GUCs */
1414
extern bool gp_enable_resqueue_priority;
15-
extern bool gp_enable_fork_lock;
15+
extern bool gp_enable_fork_sleep;
1616
extern int gp_resqueue_priority_local_interval;
1717
extern int gp_resqueue_priority_sweeper_interval;
1818
extern int gp_resqueue_priority_inactivity_timeout;

src/include/utils/sync_guc_name.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"gp_enable_mk_sort",
2424
"gp_enable_motion_mk_sort",
2525
"gp_enable_segment_copy_checking",
26-
"gp_enable_fork_lock",
26+
"gp_enable_fork_sleep",
2727
"gp_external_enable_filter_pushdown",
2828
"gp_gpperfmon_send_interval",
2929
"gp_hashagg_default_nbatches",

0 commit comments

Comments
 (0)