Re: [HACKERS] Open 6.5 items

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Ole Gjerde <gjerde(at)icebox(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Open 6.5 items
Date: 1999-05-17 06:39:48
Message-ID: 199905170639.CAA01971@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


List updated. Patch applied. Thanks.

> On Sun, 16 May 1999, Bruce Momjian wrote:
> > nodeResults.c and parse_clause.c give compiler warnings
>
> No warnings on Redhat Linux 6.0 (Linux 2.2.7, egcs 1.1.2, glibc 2.1)
>
> > DROP TABLE leaves INDEX file descriptor open
>
> Shouldn't now.. index_destroy() gets called, which again calls smgrunlink.
> It looks like smgrunlink closes all fds.
>
> > DROP TABLE/RENAME TABLE doesn't remove extended files, *.1, *.2
>
> This now works(with the patch from yesterday).
>
> > Vacuum of tables >2 gigs - NOTICE: Can't truncate multi-segments relation
>
> This is actually more of a fundamental problem with mdtruncate. It looks
> like someone just didn't add support for multiple segments for truncation.
>
> The following patch seems to do the right thing, for me at least.
> It passed my tests, my data looks right(no data that shouldn't be in
> there) and regression is ok.
>
> Ole Gjerde
>
> --- src/backend/storage/smgr/md.c 1999/04/05 22:25:11 1.42
> +++ src/backend/storage/smgr/md.c 1999/05/17 06:23:23
> @@ -711,15 +711,26 @@
> MdfdVec *v;
>
> #ifndef LET_OS_MANAGE_FILESIZE
> - int curnblk;
> + int curnblk,
> + i,
> + oldsegno,
> + newsegno;
> + char fname[NAMEDATALEN];
> + char tname[NAMEDATALEN + 10];
>
> curnblk = mdnblocks(reln);
> - if (curnblk / RELSEG_SIZE > 0)
> - {
> - elog(NOTICE, "Can't truncate multi-segments relation %s",
> - reln->rd_rel->relname.data);
> - return curnblk;
> - }
> + oldsegno = curnblk / RELSEG_SIZE;
> + newsegno = nblocks / RELSEG_SIZE;
> +
> + StrNCpy(fname, RelationGetRelationName(reln)->data, NAMEDATALEN);
> +
> + if (newsegno < oldsegno) {
> + for (i = (newsegno + 1);; i++) {
> + sprintf(tname, "%s.%d", fname, i);
> + if (FileNameUnlink(tname) < 0)
> + break;
> + }
> + }
> #endif
>
> fd = RelationGetFile(reln);
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vadim Mikheev 1999-05-17 07:01:19 Re: [HACKERS] DROP TABLE does not drop a table completely
Previous Message Ole Gjerde 1999-05-17 06:26:24 Re: [HACKERS] sgmr* vs. md*