Re: Unwanted LOG during recovery of DROP TABLESPACE REDO

Lists: pgsql-hackers
From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Unwanted LOG during recovery of DROP TABLESPACE REDO
Date: 2014-07-16 05:59:45
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DE171CC@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I found and fixed a bug that causes recovery (crash recovery , PITR) to throw unwanted LOG message if the tablespace symlink is not found during the processing of DROP TABLESPACE redo.
LOG: could not remove symbolic link "pg_tblspc/16384": No such file or directory

To Reproduce the issue:

1. Start the server.

2. Create a tablespace.

3. Perform Checkpoint.

4. Drop tablespace.

5. Stop server using immediate mode.

6. Start server : At this stage, recovery throw log message as mentioned above.

Reason is that DROP TABLESPACE has already removed symlink and again it is being tried to remove during recovery.
As it is very much possible that DROP TABLESPACE was successful and cleaned up the file before server crashed. So this should be considered as valid scenario and no need to throw
any LOG in such case. In case of processing of CREATE TABLESPACE redo, same is already handled.

I will add this to 2014-08 CF for review.

Thanks and Regards,
Kumar Rajeev Rastogi

Attachment Content-Type Size
rec_issue_with_drop_tblspc_redo.patch application/octet-stream 1.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unwanted LOG during recovery of DROP TABLESPACE REDO
Date: 2014-07-16 14:33:16
Message-ID: 26294.1405521196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com> writes:
> I found and fixed a bug that causes recovery (crash recovery , PITR) to throw unwanted LOG message if the tablespace symlink is not found during the processing of DROP TABLESPACE redo.
> LOG: could not remove symbolic link "pg_tblspc/16384": No such file or directory

I don't think that's a bug: it's the designed behavior. Why should we
complicate the code to not print a log message in a situation where
it's unclear if the case is expected or not?

regards, tom lane


From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unwanted LOG during recovery of DROP TABLESPACE REDO
Date: 2014-08-15 09:31:24
Message-ID: 53EDD36C.5020409@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 7/16/14 4:33 PM, Tom Lane wrote:
> Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com> writes:
>> I found and fixed a bug that causes recovery (crash recovery , PITR) to throw unwanted LOG message if the tablespace symlink is not found during the processing of DROP TABLESPACE redo.
>> LOG: could not remove symbolic link "pg_tblspc/16384": No such file or directory
>
> I don't think that's a bug: it's the designed behavior. Why should we
> complicate the code to not print a log message in a situation where
> it's unclear if the case is expected or not?

I agree with Tom here; this doesn't seem like an improvement.

.marko


From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Rajeev rastogi" <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unwanted LOG during recovery of DROP TABLESPACE REDO
Date: 2014-08-25 15:04:50
Message-ID: 53FB5092.4010603@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 08/15/2014 12:31 PM, Marko Tiikkaja wrote:
> On 7/16/14 4:33 PM, Tom Lane wrote:
>> Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com> writes:
>>> I found and fixed a bug that causes recovery (crash recovery , PITR) to throw unwanted LOG message if the tablespace symlink is not found during the processing of DROP TABLESPACE redo.
>>> LOG: could not remove symbolic link "pg_tblspc/16384": No such file or directory
>>
>> I don't think that's a bug: it's the designed behavior. Why should we
>> complicate the code to not print a log message in a situation where
>> it's unclear if the case is expected or not?
>
> I agree with Tom here; this doesn't seem like an improvement.

Well, for comparison, we also silently ignore non-existent files when
replaying a "DROP TABLE". I could go either way myself, but this is
clearly a very minor thing, and we have two -1's, so I'm marking this as
"Rejected" in the commitfest.

Thanks anyway!

- Heikki