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

Commitfc5e74a

Browse files
author
Vladimir Ershov
committed
Merge commit '8e8475aad70c0baf6a2711791539ffdde4e280aa' into PGPROEE9_6_scheduler
2 parentsf775ad3 +8e8475a commitfc5e74a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

‎contrib/pgpro_scheduler/pgpro_scheduler--2.0.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ CREATE TABLE at_jobs_submitted(
2525
canceledboolean default false,
2626
submit_timetimestamp with time zone default now()
2727
);
28-
CREATEINDEXat_jobs_submitted_node_at_idxon at_jobs_submitted (node, at);
28+
CREATEINDEXON at_jobs_submitted(at,submit_time);
29+
CREATEINDEXON at_jobs_submitted (last_start_available, node);
2930

3031
CREATETABLEat_jobs_process(
3132
start_timetimestamp with time zone default now()
3233
) INHERITS (at_jobs_submitted);
3334

35+
ALTERTABLE at_jobs_process ADDprimary key (id);
3436
CREATEINDEXat_jobs_process_node_at_idxon at_jobs_process (node, at);
3537

3638
CREATETABLEat_jobs_done(
@@ -39,6 +41,7 @@ CREATE TABLE at_jobs_done(
3941
done_timetimestamp with time zone default now()
4042
) INHERITS (at_jobs_process);
4143

44+
ALTERTABLE at_jobs_done ADDprimary key (id);
4245
CREATEINDEXat_jobs_done_node_at_idxon at_jobs_done (node, at);
4346

4447
CREATETABLEcron(
@@ -64,6 +67,7 @@ CREATE TABLE cron(
6467
reasontext,
6568
_next_exec_timetimestamp with time zone
6669
);
70+
createindexon cron (node);
6771

6872
CREATETABLEat(
6973
start_attimestamp with time zone,

‎contrib/pgpro_scheduler/src/scheduler_manager.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,7 @@ void manager_worker_main(Datum arg)
14921492
ctx=initialize_scheduler_manager_context(database,seg);
14931493
clean_at_table(ctx);
14941494
set_slots_stat_report(ctx);
1495+
SetConfigOption("enable_seqscan","off",PGC_USERSET,PGC_S_SESSION);
14951496

14961497
while(!got_sigterm)
14971498
{
@@ -1509,7 +1510,7 @@ void manager_worker_main(Datum arg)
15091510
if(!got_sighup&& !got_sigterm)
15101511
{
15111512
terminate_main_loop=0;
1512-
while(1)
1513+
while(!got_sighup&& !got_sigterm)
15131514
{
15141515
wait=0;
15151516
if(check_parent_stop_signal(ctx))
@@ -1521,11 +1522,12 @@ void manager_worker_main(Datum arg)
15211522
wait+=scheduler_start_jobs(ctx,CronJob);
15221523
scheduler_check_slots(ctx,&(ctx->at));
15231524
scheduler_check_slots(ctx,&(ctx->cron));
1524-
set_slots_stat_report(ctx);
1525+
scheduler_make_atcron_record(ctx);
1526+
/* set_slots_stat_report(ctx); */
15251527
if(wait==0)break;
15261528
}
15271529
if(terminate_main_loop)break;
1528-
scheduler_make_atcron_record(ctx);
1530+
set_slots_stat_report(ctx);
15291531
/* if there are any expired jobs to get rid of */
15301532
scheduler_vanish_expired_jobs(ctx,AtJob);
15311533
scheduler_vanish_expired_jobs(ctx,CronJob);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp