aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-05-09 23:44:21 -0400
committerRobert Haas <rhaas@postgresql.org>2017-05-09 23:44:21 -0400
commita5775991bb86d95939b3eb1173b88d8c5312962d (patch)
tree9bfbd760b021bf1ee9c1315ae1d3d710109b50d8
parentdf1a4eba948f386845f75c2864de0a35e5ede849 (diff)
downloadpostgresql-a5775991bb86d95939b3eb1173b88d8c5312962d.tar.gz
postgresql-a5775991bb86d95939b3eb1173b88d8c5312962d.zip
Remove no-longer-needed compatibility code for hash indexes.
Because commit ea69a0dead5128c421140dc53fac165ba4af8520 bumped the HASH_VERSION, we don't need to worry about PostgreSQL 10 seeing bucket pages from earlier versions. Amit Kapila Discussion: http://postgr.es/m/CAA4eK1LAo4DGwh+mi-G3U8Pj1WkBBeFL38xdCnUHJv1z4bZFkQ@mail.gmail.com
-rw-r--r--src/backend/access/hash/hash.c8
-rw-r--r--src/backend/access/hash/hashpage.c8
2 files changed, 4 insertions, 12 deletions
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c
index 3eb5b1d0d5e..df54638f3e0 100644
--- a/src/backend/access/hash/hash.c
+++ b/src/backend/access/hash/hash.c
@@ -624,13 +624,9 @@ loop_top:
* now that the primary page of the target bucket has been locked
* (and thus can't be further split), check whether we need to
* update our cached metapage data.
- *
- * NB: The check for InvalidBlockNumber is only needed for
- * on-disk compatibility with indexes created before we started
- * storing hashm_maxbucket in the primary page's hasho_prevblkno.
*/
- if (bucket_opaque->hasho_prevblkno != InvalidBlockNumber &&
- bucket_opaque->hasho_prevblkno > cachedmetap->hashm_maxbucket)
+ Assert(bucket_opaque->hasho_prevblkno != InvalidBlockNumber);
+ if (bucket_opaque->hasho_prevblkno > cachedmetap->hashm_maxbucket)
{
cachedmetap = _hash_getcachedmetap(rel, &metabuf, true);
Assert(cachedmetap != NULL);
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index 3cd4daa3250..bf1ffff4e8c 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -1564,16 +1564,12 @@ _hash_getbucketbuf_from_hashkey(Relation rel, uint32 hashkey, int access,
page = BufferGetPage(buf);
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
Assert(opaque->hasho_bucket == bucket);
+ Assert(opaque->hasho_prevblkno != InvalidBlockNumber);
/*
* If this bucket hasn't been split, we're done.
- *
- * NB: The check for InvalidBlockNumber is only needed for on-disk
- * compatibility with indexes created before we started storing
- * hashm_maxbucket in the primary page's hasho_prevblkno.
*/
- if (opaque->hasho_prevblkno == InvalidBlockNumber ||
- opaque->hasho_prevblkno <= metap->hashm_maxbucket)
+ if (opaque->hasho_prevblkno <= metap->hashm_maxbucket)
break;
/* Drop lock on this buffer, update cached metapage, and retry. */