an outdated comment for hash_seq_init.

Started by Kyotaro HORIGUCHIover 8 years ago3 messages
#1Kyotaro HORIGUCHI
horiguchi.kyotaro@lab.ntt.co.jp
1 attachment(s)

Hello.

While I looked into dynahash.c, I found that the following
sentense became outdated by 5dfc198. The commit removed the only
usage of hash_freeze().

* NOTE: it is possible to use hash_seq_init/hash_seq_search without any
* worry about hash_seq_term cleanup, if the hashtable is first locked against
* further insertions by calling hash_freeze. This is used by nodeAgg.c,
* wherein it is inconvenient to track whether a scan is still open, and
* there's no possibility of further insertions after readout has begun.

The attached patch removes the sentence begins with "This is used
by..".

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

edit_comment_for_hash_seq_init.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index 12b1658..1adc5841 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -1330,9 +1330,7 @@ hash_get_num_entries(HTAB *hashp)
  *
  * NOTE: it is possible to use hash_seq_init/hash_seq_search without any
  * worry about hash_seq_term cleanup, if the hashtable is first locked against
- * further insertions by calling hash_freeze.  This is used by nodeAgg.c,
- * wherein it is inconvenient to track whether a scan is still open, and
- * there's no possibility of further insertions after readout has begun.
+ * further insertions by calling hash_freeze.
  *
  * NOTE: to use this with a partitioned hashtable, caller had better hold
  * at least shared lock on all partitions of the table throughout the scan!
#2Robert Haas
robertmhaas@gmail.com
In reply to: Kyotaro HORIGUCHI (#1)
Re: an outdated comment for hash_seq_init.

On Mon, Apr 24, 2017 at 3:55 AM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

While I looked into dynahash.c, I found that the following
sentense became outdated by 5dfc198. The commit removed the only
usage of hash_freeze().

* NOTE: it is possible to use hash_seq_init/hash_seq_search without any
* worry about hash_seq_term cleanup, if the hashtable is first locked against
* further insertions by calling hash_freeze. This is used by nodeAgg.c,
* wherein it is inconvenient to track whether a scan is still open, and
* there's no possibility of further insertions after readout has begun.

The attached patch removes the sentence begins with "This is used
by..".

Committed.

--
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

#3Kyotaro HORIGUCHI
horiguchi.kyotaro@lab.ntt.co.jp
In reply to: Robert Haas (#2)
Re: an outdated comment for hash_seq_init.

At Tue, 25 Apr 2017 11:00:16 -0400, Robert Haas <robertmhaas@gmail.com> wrote in <CA+TgmobU=F1JtGZ+bL91D7sE2+cBybmJ+WMQdmTT0cyV2dvO0Q@mail.gmail.com>

On Mon, Apr 24, 2017 at 3:55 AM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

While I looked into dynahash.c, I found that the following
sentense became outdated by 5dfc198. The commit removed the only
usage of hash_freeze().

* NOTE: it is possible to use hash_seq_init/hash_seq_search without any
* worry about hash_seq_term cleanup, if the hashtable is first locked against
* further insertions by calling hash_freeze. This is used by nodeAgg.c,
* wherein it is inconvenient to track whether a scan is still open, and
* there's no possibility of further insertions after readout has begun.

The attached patch removes the sentence begins with "This is used
by..".

Committed.

Thanks.

--
Kyotaro Horiguchi
NTT Open Source Software Center

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