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

Re: xlog location arithmetic

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: xlog location arithmetic
Date: 2012-02-07 17:29:16
Message-ID: 4F315F6C.8030700@timbira.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On 26-01-2012 06:19, Fujii Masao wrote:

Thanks for your review. Comments below.

> When I compiled the source with xlogdiff.patch, I got the following warnings.
> 
> xlogfuncs.c:511:2: warning: format '%lX' expects argument of type
> 'long unsigned int *', but argument 3 has type 'uint64 *' [-Wformat]
> 
What is your compiler? I'm using gcc 4.6.2. I refactored the patch so I'm now
using XLogRecPtr and %X.

> postgres=# SELECT pg_xlog_location_diff('0/2000074', '0/2000074');
> ERROR:  xrecoff "2000074" is out of valid range, 0..A4A534C
> 
Ugh? I can't reproduce that. It seems to be related to long int used by the
prior version.

> Since pg_xlog_location_diff() can be executed during recovery,
> the above needs to be updated.
> 
Fixed.

>> While the output was int8 I could use
>> pg_size_pretty but now I couldn't. I attached another patch that implements
>> pg_size_pretty(numeric).
> 
I realized that it collides with the pg_size_pretty(int8) if we don't specify
a type. Hence, I decided to drop the pg_size_pretty(int8) in favor of
pg_size_pretty(numeric). It is slower than the former but it is not a
performance critical function.

> According to the above source code comment in pg_proc.h, ISTM
> pg_size_pretty() for numeric also needs to have its own DESCR().
> 
Fixed.

> According to "man strcat", the dest string must have enough space for
> the result.
> "buf" has enough space?
> 
Ops. Fixed.


-- 
   Euler Taveira de Oliveira - Timbira       http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Attachment: xlogdiff2.diff
Description: text/x-patch (6.5 KB)
Attachment: sizepretty2.diff
Description: text/x-patch (7.2 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Greg SmithDate: 2012-02-07 17:39:19
Subject: Re: some longer, larger pgbench tests with various performance-related patches
Previous:From: Greg SmithDate: 2012-02-07 17:04:52
Subject: Re: double writes using "double-write buffer" approach [WIP]

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