Skip site navigation (1) Skip section navigation (2)

xlog location arithmetic

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: xlog location arithmetic
Date: 2011-12-06 04:19:49
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers

A while ago when blogging about WAL [1], I noticed a function to deal with
xlog location arithmetic is wanted. I remembered Depez [2] mentioning it and
after some questions during trainings and conferences I decided to translate
my shell script function in C.

The attached patch implements the function pg_xlog_location_diff (bikeshed
colors are welcome). It calculates the difference between two given
transaction log locations. Now that we have pg_stat_replication view, it will
be easy to get the lag just passing columns as parameters. Also, the
monitoring tools could take advantage of it instead of relying on a fragile
routine to get the lag.

I noticed that pg_xlogfile_name* functions does not sanity check the xrecoff
boundaries but that is material for another patch.


   Euler Taveira de Oliveira - Timbira
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Attachment: xlogdiff.patch
Description: text/x-patch (5.1 KB)


pgsql-hackers by date

Next:From: Noah MischDate: 2011-12-06 06:16:48
Subject: Re: Configuration include directory
Previous:From: Robert HaasDate: 2011-12-06 03:36:24
Subject: pull_up_simple_subquery

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group