Unix Technical Forum

trivial fix in fd.c

This is a discussion on trivial fix in fd.c within the Pgsql Patches forums, part of the PostgreSQL category; --> Fix a format warning in fd.c when FDDEBUG is on. By the way (to save a thread): What's the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:39 AM
Qingqing Zhou
 
Posts: n/a
Default trivial fix in fd.c

Fix a format warning in fd.c when FDDEBUG is on.

By the way (to save a thread): What's the rationale of designing resowner
APIs like this:

ResourceOwnerEnlargeABC();
ResourceOwnerRememberABC();

Is that because sometimes we don't allow any elog in
ResourceOwnerRememberABC()?

Regards,
Qingqing


Index: fd.c
================================================== =================
RCS file: /projects/cvsroot/pgsql/src/backend/storage/file/fd.c,v
retrieving revision 1.127
diff -c -r1.127 fd.c
*** fd.c 5 Mar 2006 15:58:37 -0000 1.127
--- fd.c 22 May 2006 08:00:42 -0000
***************
*** 649,655 ****
Index i;
File file;

! DO_DB(elog(LOG, "AllocateVfd. Size %d", SizeVfdCache));

Assert(SizeVfdCache > 0); /* InitFileAccess not called? */

--- 649,655 ----
Index i;
File file;

! DO_DB(elog(LOG, "AllocateVfd. Size %lu", SizeVfdCache));

Assert(SizeVfdCache > 0); /* InitFileAccess not called? */



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:39 AM
Tom Lane
 
Posts: n/a
Default Re: trivial fix in fd.c

"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> What's the rationale of designing resowner
> APIs like this:


> ResourceOwnerEnlargeABC();
> ResourceOwnerRememberABC();


> Is that because sometimes we don't allow any elog in
> ResourceOwnerRememberABC()?


Yeah. In a number of cases, ResourceOwnerRememberABC is done after
inserting the resource into some data structure, and an elog there
would leave the data structure in an inconsistent state. Conversely,
we might fail to insert the resource into the other data structure,
so just inserting it into the resowner first isn't better.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:40 AM
Bruce Momjian
 
Posts: n/a
Default Re: trivial fix in fd.c


Patch applied. Thanks.

---------------------------------------------------------------------------


Qingqing Zhou wrote:
> Fix a format warning in fd.c when FDDEBUG is on.
>
> By the way (to save a thread): What's the rationale of designing resowner
> APIs like this:
>
> ResourceOwnerEnlargeABC();
> ResourceOwnerRememberABC();
>
> Is that because sometimes we don't allow any elog in
> ResourceOwnerRememberABC()?
>
> Regards,
> Qingqing
>
>
> Index: fd.c
> ================================================== =================
> RCS file: /projects/cvsroot/pgsql/src/backend/storage/file/fd.c,v
> retrieving revision 1.127
> diff -c -r1.127 fd.c
> *** fd.c 5 Mar 2006 15:58:37 -0000 1.127
> --- fd.c 22 May 2006 08:00:42 -0000
> ***************
> *** 649,655 ****
> Index i;
> File file;
>
> ! DO_DB(elog(LOG, "AllocateVfd. Size %d", SizeVfdCache));
>
> Assert(SizeVfdCache > 0); /* InitFileAccess not called? */
>
> --- 649,655 ----
> Index i;
> File file;
>
> ! DO_DB(elog(LOG, "AllocateVfd. Size %lu", SizeVfdCache));
>
> Assert(SizeVfdCache > 0); /* InitFileAccess not called? */
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>


--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:48 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com