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

Re: Tablespaces

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Tablespaces
Date: 2004-06-16 19:17:53
Message-ID: 29607.1087413473@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
I'm starting to review this patch, and almost immediately came across
what seemed a spectacularly bad idea:

*** src/backend/storage/buffer/bufmgr.c    8 May 2004 19:09:25 -0000    1.165
--- src/backend/storage/buffer/bufmgr.c    26 May 2004 06:21:01 -0000
***************
*** 1148,1152 ****
          {
              bufHdr = &LocalBufferDescriptors[i];
!             if (RelFileNodeEquals(bufHdr->tag.rnode, rnode))
              {
                  bufHdr->flags &= ~(BM_DIRTY | BM_JUST_DIRTIED);
--- 1148,1156 ----
          {
              bufHdr = &LocalBufferDescriptors[i];
!             /* special case for default tblNode */
!             if (RelFileNodeEquals(bufHdr->tag.rnode, rnode) ||
!                     (!OidIsValid(rnode.tblNode) &&
!                      bufHdr->tag.rnode.relNode == rnode.relNode &&
!                      bufHdr->tag.rnode.dbNode == rnode.dbNode))
              {
                  bufHdr->flags &= ~(BM_DIRTY | BM_JUST_DIRTIED);

There has got to be a better way than this.  In the first place the
code seems able to seize on the wrong buffer if it's not checking
all three fields; in the second place, if the weak matching is correct
here why is it not needed everyplace else?

What's the purpose of this?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Gavin SherryDate: 2004-06-16 21:11:18
Subject: Re: Tablespaces
Previous:From: Andreas PflugDate: 2004-06-16 19:03:52
Subject: Re: logfile rotation

pgsql-patches by date

Next:From: Gavin SherryDate: 2004-06-16 21:11:18
Subject: Re: Tablespaces
Previous:From: Claudio NatoliDate: 2004-06-16 15:30:14
Subject: Re: pg_ctl service integration for WIN32

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