Re: pgAgent queries

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>
Cc: <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: pgAgent queries
Date: 2005-03-02 13:57:57
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E472B89F@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Andreas Pflug [mailto:pgadmin(at)pse-consulting(dot)de]
> Sent: 02 March 2005 09:28
> To: Dave Page
> Subject: Re: pgAgent queries
>
> Dave Page wrote:
> > Hi Andreas,
> >
> > I've got a couple of questions on pgAgent if I may...
>
> Sure!
>
> > - In pgAgent.cpp, you run various queries to find and
> cleanup 'orphaned'
> > jobs. It's not entirely obviously what you're trying to do here,
> > especially as the first query seems somewhat bogus:
> >
> > rc = serviceConn->ExecuteVoid(
> > "INSERT INTO pga_tmp_zombies (jagpid)\n"
> > "SELECT jagpid\n"
> > " FROM pgadmin.pga_jobagent AG\n"
> > " LEFT JOIN pg_stat_activity PA ON jagpid=procpid\n"
> > " WHERE procpid IS NULL"
> > );
> >
> > Specifically, you're joining on procpid /and/ requiring it
> to be null,
> > in a case where one would assume that an orphaned job would
> be one where
> > jagpid is definitely not null.
>
> Yes, jagpid not null, but procpid, i.e. job was started on a backend
> that's not there any more!
>
> This is yielding the same sa
> SELECT * from jobagent
> WHERE jagpid NOT IN (select procpid from pg_stat_activity)

Ahh, yes - I totally failed to grok the fact it was a left join!

> > - Second, schedule representation. The UI doesn't seem to
> even remotely
> > match the table def, so I assume that was basically a WIP when you
> > stopped.
>
> Yes. Major rewrite was intended, I wasn't happy with it.
> What I wanted was a sophisticated scheduling scheme as found
> in backup
> programs:
> - repetitive in known intervals

OK, that's easy.

> - on certain days (weekday, monthday)

Weekday is easy as weeks are all 7 days long. Monthdays start to get
tricky.

> - Exceptions, e.g. "run every mo/tue/wed/thu/fr, but not on
> mar22 this
> year".

Why would you want to do that?

> Do you know TapeWare? See the attached screenshot.

No - but on a completely separate note, the tape drive problem on
dev.pga.org has been tracked back to a, err, 'fix' in the latest linux
kernel.

> Well, it shouldn't be YetAnotherCron... I agree, last day of month is
> really hard. Still, reporting (data warehousing) isn't too exotic.

Hmm, I can think of more uses for last day of month et al. than
exceptions :-(. I might need to consult with Mark some more then - his
is a full featured scheduler....

Cheers, Dave

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2005-03-02 20:25:00 RFC: pgAgent Scheduler Design
Previous Message cvs 2005-03-02 09:30:24 CVS Commit by dpage: Remove pgAgent.[cpp | h]