Re: [GENERAL] Reduce the time to know trigger_fi​le's existence

From: Harshitha S <hershetha(at)gmail(dot)com>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Reduce the time to know trigger_fi​le's existence
Date: 2012-09-04 04:15:04
Message-ID: CAAe0G5tLJCCjfMLTPS9gfzQiW+EyVZewxg8k01OS6tnyqs_KxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

Can Latch - that postgres already uses, be used to achieve the same?

On Tue, Sep 4, 2012 at 6:31 AM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:

> On 09/03/2012 04:30 PM, Harshitha S wrote:
>
>> Hi,
>> We are trying to introduce a thread that monitors the creation of the
>> trigger_file. As and when the file is created, the process that monitors
>> postgres server needs to be notified through the inotify API.
>>
>
> File system notification APIs aren't portable. If you want to implement
> this you'll need to support at least the Windows FSNotify stuff,
> notification features compatible with several different Linux versions and
> with the BSDs, with a fallback to polling for other platforms.
>
> For Windows:
>
> http://msdn.microsoft.com/en-**us/library/windows/desktop/**
> aa365261(v=vs.85).aspx<http://msdn.microsoft.com/en-us/library/windows/desktop/aa365261%28v=vs.85%29.aspx>
>
> For Linux it appears that inotify has been present since 2005:
>
> http://en.wikipedia.org/wiki/**Inotify<http://en.wikipedia.org/wiki/Inotify>
>
> but it's probably best to add a configure test and fall back to polling if
> it isn't found.
>
>
>
>
> This will mean adding a new internal API and then adding backend/port/
> implementations for various platforms, as well as taking the current code
> and splitting it out into a port file that gets used if no other is chosen.
>
> This page is likely to be useful:
>
> http://wiki.postgresql.org/**wiki/So,_you_want_to_be_a_**developer%3F<http://wiki.postgresql.org/wiki/So,_you_want_to_be_a_developer%3F>
>
> --
> Craig Ringer
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Haas 2012-09-04 04:31:23 Re: [GENERAL] Multiple Slave Failover with PITR
Previous Message Chris Angelico 2012-09-04 03:52:59 Null-terminated log entries?

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-09-04 04:16:39 Re: pg_upgrade del/rmdir path fix
Previous Message Robert Haas 2012-09-04 04:01:17 Re: Proof of concept: standalone backend with full FE/BE protocol