BUG #15039: some question about hash index code

The Post Office <noreply@postgresql.org>

From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: zoulx1982@163.com
Date: 2018-01-31T11:34:46Z
Lists: pgsql-bugs, pgsql-hackers
The following bug has been logged on the website:

Bug reference:      15039
Logged by:          lixian zou
Email address:      zoulx1982@163.com
PostgreSQL version: 10.0
Operating system:   source code
Description:        

hi,
i read hash index code , and found in _hash_addovflpage function, there is
such code :
if (metap->hashm_firstfree == orig_firstfree)
{
	metap->hashm_firstfree = bit + 1;
	MarkBufferDirty(metabuf);
}

i found no any chang for metap,metap->hashm_firstfree,and initial the two
variable is equal, so maybe the if statement is redundant?

thanks. 

Commits

  1. Fix possible failure to mark hash metapage dirty.