comments in hash_alloc_buckets

Started by Ashutosh Sharmaalmost 9 years ago4 messages
#1Ashutosh Sharma
ashu.coek88@gmail.com
1 attachment(s)

Hi,

While working on - [1]/messages/by-id/CAMkU=1y6NjKmqbJ8wLMhr=F74WzcMALYWcVFhEpm7i=mV=XsOg@mail.gmail.com, I realised that the following comments in
_hash_alloc_buckets() needs to be corrected.

/*
* Initialize the freed overflow page. Just zeroing the page won't work,
* See _hash_freeovflpage for similar usage.
*/
_hash_pageinit(page, BLCKSZ);

Attached is the patch that corrects above comment. Thanks.

[1]: /messages/by-id/CAMkU=1y6NjKmqbJ8wLMhr=F74WzcMALYWcVFhEpm7i=mV=XsOg@mail.gmail.com

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

Attachments:

corrected_comments_hash_alloc_buckets.patchapplication/x-download; name=corrected_comments_hash_alloc_buckets.patchDownload
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index 622cc4b..daec329 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -1002,7 +1002,7 @@ _hash_alloc_buckets(Relation rel, BlockNumber firstblock, uint32 nblocks)
 	page = (Page) zerobuf;
 
 	/*
-	 * Initialize the freed overflow page.  Just zeroing the page won't work,
+	 * Initialize the last page in hash index. Just zeroing the page won't work,
 	 * See _hash_freeovflpage for similar usage.
 	 */
 	_hash_pageinit(page, BLCKSZ);
#2Amit Kapila
amit.kapila16@gmail.com
In reply to: Ashutosh Sharma (#1)
Re: comments in hash_alloc_buckets

On Tue, Mar 21, 2017 at 10:11 AM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:

Hi,

While working on - [1], I realised that the following comments in
_hash_alloc_buckets() needs to be corrected.

/*
* Initialize the freed overflow page. Just zeroing the page won't work,
* See _hash_freeovflpage for similar usage.
*/
_hash_pageinit(page, BLCKSZ);

Attached is the patch that corrects above comment. Thanks.

- * Initialize the freed overflow page.  Just zeroing the page won't work,
+ * Initialize the last page in hash index.

I think saying ".. last page in hash index" sounds slightly awkward as
this is the last page for current split point, how about just
"Initialize the page. ..."

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Ashutosh Sharma
ashu.coek88@gmail.com
In reply to: Amit Kapila (#2)
1 attachment(s)
Re: comments in hash_alloc_buckets

While working on - [1], I realised that the following comments in
_hash_alloc_buckets() needs to be corrected.

/*
* Initialize the freed overflow page. Just zeroing the page won't work,
* See _hash_freeovflpage for similar usage.
*/
_hash_pageinit(page, BLCKSZ);

Attached is the patch that corrects above comment. Thanks.

- * Initialize the freed overflow page.  Just zeroing the page won't work,
+ * Initialize the last page in hash index.

I think saying ".. last page in hash index" sounds slightly awkward as
this is the last page for current split point, how about just
"Initialize the page. ..."

Yes, I mean just adding "Initialize the page. ..." looks more simple
and correct. Attached is the patch with similar comment.

Attachments:

corrected_comments_hash_alloc_buckets_v2.patchapplication/x-patch; name=corrected_comments_hash_alloc_buckets_v2.patchDownload
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index 622cc4b..4fd9cbc 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -1002,7 +1002,7 @@ _hash_alloc_buckets(Relation rel, BlockNumber firstblock, uint32 nblocks)
 	page = (Page) zerobuf;
 
 	/*
-	 * Initialize the freed overflow page.  Just zeroing the page won't work,
+	 * Initialize the page.  Just zeroing the page won't work,
 	 * See _hash_freeovflpage for similar usage.
 	 */
 	_hash_pageinit(page, BLCKSZ);
#4Robert Haas
robertmhaas@gmail.com
In reply to: Ashutosh Sharma (#3)
Re: comments in hash_alloc_buckets

On Sat, Mar 25, 2017 at 3:28 AM, Ashutosh Sharma <ashu.coek88@gmail.com> wrote:

While working on - [1], I realised that the following comments in
_hash_alloc_buckets() needs to be corrected.

/*
* Initialize the freed overflow page. Just zeroing the page won't work,
* See _hash_freeovflpage for similar usage.
*/
_hash_pageinit(page, BLCKSZ);

Attached is the patch that corrects above comment. Thanks.

- * Initialize the freed overflow page.  Just zeroing the page won't work,
+ * Initialize the last page in hash index.

I think saying ".. last page in hash index" sounds slightly awkward as
this is the last page for current split point, how about just
"Initialize the page. ..."

Yes, I mean just adding "Initialize the page. ..." looks more simple
and correct. Attached is the patch with similar comment.

Committed with a punctuation and formatting adjustment.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers