agora inbox for [email protected]
help / color / mirror / Atom feed[PATCH v1 07/19] comment typos
29+ messages / 4 participants
[nested] [flat]
* [PATCH v4 12/12] comment typos
@ 2020-02-17 18:33 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2020-02-17 18:33 UTC (permalink / raw)
---
contrib/pgcrypto/imath.c | 4 ++--
src/backend/access/transam/multixact.c | 2 +-
src/backend/partitioning/partbounds.c | 2 +-
src/include/lib/simplehash.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c
index da4cdede76..a05a4bf5fd 100644
--- a/contrib/pgcrypto/imath.c
+++ b/contrib/pgcrypto/imath.c
@@ -3232,7 +3232,7 @@ s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c)
We diverge from Knuth's algorithm in that we do not perform the subtraction
from the remainder until we have determined that we have the correct
- quotient digit. This makes our algorithm less efficient that Knuth because
+ quotient digit. This makes our algorithm less efficient than Knuth because
we might have to perform multiple multiplication and comparison steps before
the subtraction. The advantage is that it is easy to implement and ensure
correctness without worrying about underflow from the subtraction.
@@ -3355,7 +3355,7 @@ s_udiv_knuth(mp_int u, mp_int v)
/*
* Check to see if qhat > b, and decrease qhat if so. Theorem B
- * guarantess that qhat is at most 2 larger than the actual value, so
+ * guarantees that qhat is at most 2 larger than the actual value, so
* it is possible that qhat is greater than the maximum value that
* will fit in a digit
*/
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 70d0e1c215..e2aa5c9ce4 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2666,7 +2666,7 @@ SetOffsetVacuumLimit(bool is_startup)
* We use this to determine whether the addition is "wrapping around" the
* boundary point, hence the name. The reason we don't want to use the regular
* 2^31-modulo arithmetic here is that we want to be able to use the whole of
- * the 2^32-1 space here, allowing for more multixacts that would fit
+ * the 2^32-1 space here, allowing for more multixacts than would fit
* otherwise.
*/
static bool
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index 4681441dcc..b9c65ff87c 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -1224,7 +1224,7 @@ merge_list_bounds(FmgrInfo *partsupfunc, Oid *partcollation,
Assert(inner_index >= 0);
/*
- * Try merging both paritions. If successful, add the list value
+ * Try merging both partitions. If successful, add the list value
* and index of the merged partition below.
*/
merged_index = merge_matching_partitions(&outer_map, &inner_map,
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index f7af921f5a..88f4c9a53f 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -560,7 +560,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--DiL7RhKs8rK9YGuF--
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH v1 07/19] comment typos
@ 2020-02-17 18:33 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2020-02-17 18:33 UTC (permalink / raw)
---
contrib/pgcrypto/imath.c | 4 ++--
src/backend/access/transam/multixact.c | 2 +-
src/backend/commands/tablecmds.c | 2 +-
src/backend/executor/execExpr.c | 2 +-
src/backend/postmaster/bgworker.c | 2 +-
src/include/lib/simplehash.h | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/contrib/pgcrypto/imath.c b/contrib/pgcrypto/imath.c
index da4cdede76..a05a4bf5fd 100644
--- a/contrib/pgcrypto/imath.c
+++ b/contrib/pgcrypto/imath.c
@@ -3232,7 +3232,7 @@ s_embar(mp_int a, mp_int b, mp_int m, mp_int mu, mp_int c)
We diverge from Knuth's algorithm in that we do not perform the subtraction
from the remainder until we have determined that we have the correct
- quotient digit. This makes our algorithm less efficient that Knuth because
+ quotient digit. This makes our algorithm less efficient than Knuth because
we might have to perform multiple multiplication and comparison steps before
the subtraction. The advantage is that it is easy to implement and ensure
correctness without worrying about underflow from the subtraction.
@@ -3355,7 +3355,7 @@ s_udiv_knuth(mp_int u, mp_int v)
/*
* Check to see if qhat > b, and decrease qhat if so. Theorem B
- * guarantess that qhat is at most 2 larger than the actual value, so
+ * guarantees that qhat is at most 2 larger than the actual value, so
* it is possible that qhat is greater than the maximum value that
* will fit in a digit
*/
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 70d0e1c215..e2aa5c9ce4 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -2666,7 +2666,7 @@ SetOffsetVacuumLimit(bool is_startup)
* We use this to determine whether the addition is "wrapping around" the
* boundary point, hence the name. The reason we don't want to use the regular
* 2^31-modulo arithmetic here is that we want to be able to use the whole of
- * the 2^32-1 space here, allowing for more multixacts that would fit
+ * the 2^32-1 space here, allowing for more multixacts than would fit
* otherwise.
*/
static bool
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 6162fb018c..037d457c3d 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -16846,7 +16846,7 @@ ATExecDetachPartition(Relation rel, RangeVar *name)
list_free_deep(fks);
/*
- * Any sub-constrains that are in the referenced-side of a larger
+ * Any sub-constraints that are in the referenced-side of a larger
* constraint have to be removed. This partition is no longer part of the
* key space of the constraint.
*/
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c
index 1370ffec50..c6a77bd66f 100644
--- a/src/backend/executor/execExpr.c
+++ b/src/backend/executor/execExpr.c
@@ -2366,7 +2366,7 @@ get_last_attnums_walker(Node *node, LastAttnumInfo *info)
* evaluation of the expression will have the same type of slot, with an
* equivalent descriptor.
*
- * Returns true if the the deforming step is required, false otherwise.
+ * Returns true if the deforming step is required, false otherwise.
*/
static bool
ExecComputeSlotInfo(ExprState *state, ExprEvalStep *op)
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index 6c684b5e12..beb5e85434 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -1149,7 +1149,7 @@ WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle *handle)
* Instruct the postmaster to terminate a background worker.
*
* Note that it's safe to do this without regard to whether the worker is
- * still running, or even if the worker may already have existed and been
+ * still running, or even if the worker may already have exited and been
* unregistered.
*/
void
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 8cb03cda6c..88f4c9a53f 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -560,7 +560,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
@@ -633,7 +633,7 @@ restart:
/* shift forward, starting at last occupied element */
/*
- * TODO: This could be optimized to be one memcpy in may cases,
+ * TODO: This could be optimized to be one memcpy in many cases,
* excepting wrapping around at the end of ->data. Hasn't shown up
* in profiles so far though.
*/
--
2.17.0
--4ybNbZnZ8tziJ7D6
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v1-0008-doc-pg_stat_progress_basebackup.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/21] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--jI8keyz6grp/JLjh
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 05/18] comment typos
@ 2021-02-10 23:45 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2021-02-10 23:45 UTC (permalink / raw)
---
src/include/lib/simplehash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/lib/simplehash.h b/src/include/lib/simplehash.h
index 395be1ca9a..99a03c8f21 100644
--- a/src/include/lib/simplehash.h
+++ b/src/include/lib/simplehash.h
@@ -626,7 +626,7 @@ restart:
uint32 curoptimal;
SH_ELEMENT_TYPE *entry = &data[curelem];
- /* any empty bucket can directly be used */
+ /* any empty bucket can be used directly */
if (entry->status == SH_STATUS_EMPTY)
{
tb->members++;
--
2.17.0
--lc9FT7cWel8HagAv
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0006-One-fewer-not-one-less.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* [PATCH 02/10] comment typos
@ 2023-01-15 23:00 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Justin Pryzby @ 2023-01-15 23:00 UTC (permalink / raw)
---
src/backend/commands/dbcommands.c | 2 +-
src/backend/executor/execMain.c | 2 +-
src/backend/jit/llvm/llvmjit_inline.cpp | 2 +-
src/backend/replication/logical/snapbuild.c | 2 +-
src/backend/replication/walsender.c | 6 +++---
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_dumpall.c | 2 +-
src/include/lib/ilist.h | 2 +-
src/test/regress/expected/alter_table.out | 2 +-
src/test/regress/expected/create_procedure.out | 2 +-
src/test/regress/sql/alter_table.sql | 2 +-
src/test/regress/sql/create_procedure.sql | 2 +-
src/test/subscription/t/031_column_list.pl | 2 +-
13 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 1f4ce2fb9cf..ef05633bb05 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -3090,7 +3090,7 @@ dbase_redo(XLogReaderState *record)
/*
* There's a case where the copy source directory is missing for the
- * same reason above. Create the emtpy source directory so that
+ * same reason above. Create the empty source directory so that
* copydir below doesn't fail. The directory will be dropped soon by
* recovery.
*/
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index a5115b9c1f7..39bfb48dc22 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -134,7 +134,7 @@ ExecutorStart(QueryDesc *queryDesc, int eflags)
/*
* In some cases (e.g. an EXECUTE statement) a query execution will skip
* parse analysis, which means that the query_id won't be reported. Note
- * that it's harmless to report the query_id multiple time, as the call
+ * that it's harmless to report the query_id multiple times, as the call
* will be ignored if the top level query_id has already been reported.
*/
pgstat_report_query_id(queryDesc->plannedstmt->queryId, false);
diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp
index dc35e002f51..c765add8564 100644
--- a/src/backend/jit/llvm/llvmjit_inline.cpp
+++ b/src/backend/jit/llvm/llvmjit_inline.cpp
@@ -753,7 +753,7 @@ function_inlinable(llvm::Function &F,
/* import referenced function itself */
importVars.insert(referencedFunction->getName());
- /* import referenced function and its dependants */
+ /* import referenced function and its dependents */
for (auto& recImportVar : recImportVars)
importVars.insert(recImportVar.first());
}
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 829c5681120..62542827e4b 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1816,7 +1816,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn)
fsync_fname("pg_logical/snapshots", true);
/*
- * Now there's no way we can loose the dumped state anymore, remember this
+ * Now there's no way we can lose the dumped state anymore, remember this
* as a serialization point.
*/
builder->last_serialized_snapshot = lsn;
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 4ed3747e3f9..75e8363e248 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -2050,9 +2050,9 @@ PhysicalConfirmReceivedLocation(XLogRecPtr lsn)
/*
* One could argue that the slot should be saved to disk now, but that'd
- * be energy wasted - the worst lost information can do here is give us
- * wrong information in a statistics view - we'll just potentially be more
- * conservative in removing files.
+ * be energy wasted - the worst thing lost information could cause here is
+ * to give wrong information in a statistics view - we'll just potentially
+ * be more conservative in removing files.
*/
}
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index d1e54644a94..7529367a7b9 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -99,7 +99,7 @@ static size_t _CustomReadFunc(ArchiveHandle *AH, char **buf, size_t *buflen);
* It's task is to create any extra archive context (using AH->formatData),
* and to initialize the supported function pointers.
*
- * It should also prepare whatever it's input source is for reading/writing,
+ * It should also prepare whatever its input source is for reading/writing,
* and in the case of a read mode connection, it should load the Header & TOC.
*/
void
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index fbd1c6fc85b..cd421c59443 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -995,7 +995,7 @@ dumpRoleMembership(PGconn *conn)
fprintf(OPF, "--\n-- Role memberships\n--\n\n");
/*
- * We can't dump these GRANT commands in arbitary order, because a role
+ * We can't dump these GRANT commands in arbitrary order, because a role
* that is named as a grantor must already have ADMIN OPTION on the
* role for which it is granting permissions, except for the boostrap
* superuser, who can always be named as the grantor.
diff --git a/src/include/lib/ilist.h b/src/include/lib/ilist.h
index e03aa1c683b..095107a99c4 100644
--- a/src/include/lib/ilist.h
+++ b/src/include/lib/ilist.h
@@ -39,7 +39,7 @@
* operations that can be done without branches (and thus faster) on lists
* that use circular representation. However, it is often convenient to
* initialize list headers to zeroes rather than setting them up with an
- * explicit initialization function, so we also allow the NULL initalization.
+ * explicit initialization function, so we also allow the NULL initialization.
*
* EXAMPLES
*
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 9e5f6c1a804..97bfc3475b6 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -2566,7 +2566,7 @@ select * from at_view_2;
drop view at_view_2;
drop view at_view_1;
drop table at_base_table;
--- check adding a column not iself requiring a rewrite, together with
+-- check adding a column not itself requiring a rewrite, together with
-- a column requiring a default (bug #16038)
-- ensure that rewrites aren't silently optimized away, removing the
-- value of the test
diff --git a/src/test/regress/expected/create_procedure.out b/src/test/regress/expected/create_procedure.out
index 46c827f9791..f2a677fa552 100644
--- a/src/test/regress/expected/create_procedure.out
+++ b/src/test/regress/expected/create_procedure.out
@@ -100,7 +100,7 @@ SELECT * FROM cp_test ORDER BY b COLLATE "C";
1 | xyzzy
(4 rows)
--- utitlity functions currently not supported here
+-- utility functions currently not supported here
CREATE PROCEDURE ptestx()
LANGUAGE SQL
BEGIN ATOMIC
diff --git a/src/test/regress/sql/alter_table.sql b/src/test/regress/sql/alter_table.sql
index f58b2f75d5b..b5d57a771ae 100644
--- a/src/test/regress/sql/alter_table.sql
+++ b/src/test/regress/sql/alter_table.sql
@@ -1635,7 +1635,7 @@ drop view at_view_2;
drop view at_view_1;
drop table at_base_table;
--- check adding a column not iself requiring a rewrite, together with
+-- check adding a column not itself requiring a rewrite, together with
-- a column requiring a default (bug #16038)
-- ensure that rewrites aren't silently optimized away, removing the
diff --git a/src/test/regress/sql/create_procedure.sql b/src/test/regress/sql/create_procedure.sql
index 75cc0fcf2a6..35b872779ef 100644
--- a/src/test/regress/sql/create_procedure.sql
+++ b/src/test/regress/sql/create_procedure.sql
@@ -42,7 +42,7 @@ CALL ptest1s('b');
SELECT * FROM cp_test ORDER BY b COLLATE "C";
--- utitlity functions currently not supported here
+-- utility functions currently not supported here
CREATE PROCEDURE ptestx()
LANGUAGE SQL
BEGIN ATOMIC
diff --git a/src/test/subscription/t/031_column_list.pl b/src/test/subscription/t/031_column_list.pl
index 7c313e26eea..fd77757352a 100644
--- a/src/test/subscription/t/031_column_list.pl
+++ b/src/test/subscription/t/031_column_list.pl
@@ -1034,7 +1034,7 @@ is( $node_subscriber->safe_psql('postgres', "SELECT * FROM s1.t ORDER BY a"),
4|5|6),
'two publications, publishing the same relation');
-# Now resync the subcription, but with publications in the opposite order.
+# Now resync the subscription, but with publications in the opposite order.
# The result should be the same.
$node_subscriber->safe_psql(
--
2.25.1
--kjpMrWxdCilgNbo1
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="0003-Avoid-hardcoded-reference-only-to-.gz.patch"
^ permalink raw reply [nested|flat] 29+ messages in thread
* Re: [EXTERNAL] Re: Add non-blocking version of PQcancel
@ 2024-03-13 19:00 Alvaro Herrera <[email protected]>
2024-03-13 19:08 ` Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Jacob Champion <[email protected]>
0 siblings, 1 reply; 29+ messages in thread
From: Alvaro Herrera @ 2024-03-13 19:00 UTC (permalink / raw)
To: Jelte Fennema-Nio <[email protected]>; +Cc: Tom Lane <[email protected]>; Denis Laxalde <[email protected]>; vignesh C <[email protected]>; Thomas Munro <[email protected]>; Greg Stark <[email protected]>; Gregory Stark (as CFM) <[email protected]>; Jelte Fennema <[email protected]>; Daniel Gustafsson <[email protected]>; Peter Eisentraut <[email protected]>; Andres Freund <[email protected]>; Justin Pryzby <[email protected]>; Robert Haas <[email protected]>; [email protected] <[email protected]>
On 2024-Mar-13, Jelte Fennema-Nio wrote:
> I agree it's probably a timing issue. The cancel being received after
> the query is done seems very unlikely, since the query takes 180
> seconds (assuming PG_TEST_TIMEOUT_DEFAULT is not lowered for these
> animals). I think it's more likely that the cancel request arrives too
> early, and thus being ignored because no query is running yet. The
> test already had logic to wait until the query backend was in the
> "active" state, before sending a cancel to solve that issue. But my
> guess is that that somehow isn't enough.
>
> Sadly I'm having a hard time reliably reproducing this race condition
> locally. So it's hard to be sure what is happening here. Attached is a
> patch with a wild guess as to what the issue might be (i.e. seeing an
> outdated "active" state and thus passing the check even though the
> query is not running yet)
I tried leaving the original running in my laptop to see if I could
reproduce it, but got no hits ... and we didn't get any other failures
apart from the three ones already reported ... so it's not terribly high
probability. Anyway I pushed your patch now since the theory seems
plausible; let's see if we still get the issue to reproduce. If it
does, we could make the script more verbose to hunt for further clues.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Here's a general engineering tip: if the non-fun part is too complex for you
to figure out, that might indicate the fun part is too ambitious." (John Naylor)
https://postgr.es/m/CAFBsxsG4OWHBbSDM%3DsSeXrQGOtkPiOEOuME4yD7Ce41NtaAD9g%40mail.gmail.com
^ permalink raw reply [nested|flat] 29+ messages in thread
* Re: [EXTERNAL] Re: Add non-blocking version of PQcancel
2024-03-13 19:00 Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Alvaro Herrera <[email protected]>
@ 2024-03-13 19:08 ` Jacob Champion <[email protected]>
2024-03-14 09:51 ` Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Jelte Fennema-Nio <[email protected]>
0 siblings, 1 reply; 29+ messages in thread
From: Jacob Champion @ 2024-03-13 19:08 UTC (permalink / raw)
To: Alvaro Herrera <[email protected]>; +Cc: Jelte Fennema-Nio <[email protected]>; Tom Lane <[email protected]>; Denis Laxalde <[email protected]>; vignesh C <[email protected]>; Thomas Munro <[email protected]>; Greg Stark <[email protected]>; Gregory Stark (as CFM) <[email protected]>; Jelte Fennema <[email protected]>; Daniel Gustafsson <[email protected]>; Peter Eisentraut <[email protected]>; Andres Freund <[email protected]>; Justin Pryzby <[email protected]>; Robert Haas <[email protected]>; [email protected] <[email protected]>
On Wed, Mar 13, 2024 at 12:01 PM Alvaro Herrera <[email protected]> wrote:
> On 2024-Mar-13, Jelte Fennema-Nio wrote:
> > Sadly I'm having a hard time reliably reproducing this race condition
> > locally. So it's hard to be sure what is happening here. Attached is a
> > patch with a wild guess as to what the issue might be (i.e. seeing an
> > outdated "active" state and thus passing the check even though the
> > query is not running yet)
>
> I tried leaving the original running in my laptop to see if I could
> reproduce it, but got no hits ... and we didn't get any other failures
> apart from the three ones already reported ... so it's not terribly high
> probability. Anyway I pushed your patch now since the theory seems
> plausible; let's see if we still get the issue to reproduce. If it
> does, we could make the script more verbose to hunt for further clues.
I hit this on my machine. With the attached diff I can reproduce
constantly (including with the most recent test patch); I think the
cancel must be arriving between the bind/execute steps?
Thanks,
--Jacob
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 6b7903314a..22ce7c07d9 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -2073,6 +2073,9 @@ exec_bind_message(StringInfo input_message)
valgrind_report_error_query(debug_query_string);
debug_query_string = NULL;
+
+ if (strstr(psrc->query_string, "pg_sleep"))
+ sleep(1);
}
/*
Attachments:
[text/plain] repro.diff.txt (393B, ../../CAOYmi+ns77qACkcWFnrxAyJe=KhUfUyt6a9ykbJC_7dv7PAZVw@mail.gmail.com/2-repro.diff.txt)
download | inline diff:
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 6b7903314a..22ce7c07d9 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -2073,6 +2073,9 @@ exec_bind_message(StringInfo input_message)
valgrind_report_error_query(debug_query_string);
debug_query_string = NULL;
+
+ if (strstr(psrc->query_string, "pg_sleep"))
+ sleep(1);
}
/*
^ permalink raw reply [nested|flat] 29+ messages in thread
* Re: [EXTERNAL] Re: Add non-blocking version of PQcancel
2024-03-13 19:00 Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Alvaro Herrera <[email protected]>
2024-03-13 19:08 ` Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Jacob Champion <[email protected]>
@ 2024-03-14 09:51 ` Jelte Fennema-Nio <[email protected]>
0 siblings, 0 replies; 29+ messages in thread
From: Jelte Fennema-Nio @ 2024-03-14 09:51 UTC (permalink / raw)
To: Jacob Champion <[email protected]>; +Cc: Alvaro Herrera <[email protected]>; Tom Lane <[email protected]>; Denis Laxalde <[email protected]>; vignesh C <[email protected]>; Thomas Munro <[email protected]>; Greg Stark <[email protected]>; Gregory Stark (as CFM) <[email protected]>; Jelte Fennema <[email protected]>; Daniel Gustafsson <[email protected]>; Peter Eisentraut <[email protected]>; Andres Freund <[email protected]>; Justin Pryzby <[email protected]>; Robert Haas <[email protected]>; [email protected] <[email protected]>
On Wed, 13 Mar 2024 at 20:08, Jacob Champion
<[email protected]> wrote:
> I hit this on my machine. With the attached diff I can reproduce
> constantly (including with the most recent test patch); I think the
> cancel must be arriving between the bind/execute steps?
Nice find! Your explanation makes total sense. Attached a patchset
that fixes/works around this issue by using the simple query protocol
in the cancel test.
Attachments:
[application/octet-stream] v38-0001-Use-simple-query-protocol-for-cancel-test.patch (2.3K, ../../CAGECzQQe9n8LCNzvAK08RzvYepKJMdc=2S0goQSuwD-eCS9wwQ@mail.gmail.com/2-v38-0001-Use-simple-query-protocol-for-cancel-test.patch)
download | inline diff:
From a89571fae6e91077050fc2ee6f0997376f1708fb Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <[email protected]>
Date: Thu, 14 Mar 2024 10:45:51 +0100
Subject: [PATCH v38 1/3] Use simple query protocol for cancel test
The new cancel test was randomly failing on the build farm. It turns out
that using the extended query protocol was the cause of this, because
it was possible for the cancel to arrive in between the Bind and Execute
messages. This fixes that by using the simple query protocol to send the
query that should be cancelled.
Reported-By: Jacob Champion
---
.../modules/libpq_pipeline/libpq_pipeline.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/test/modules/libpq_pipeline/libpq_pipeline.c b/src/test/modules/libpq_pipeline/libpq_pipeline.c
index e730ad37698..83f9caca726 100644
--- a/src/test/modules/libpq_pipeline/libpq_pipeline.c
+++ b/src/test/modules/libpq_pipeline/libpq_pipeline.c
@@ -165,7 +165,7 @@ static void
send_cancellable_query_impl(int line, PGconn *conn, PGconn *monitorConn)
{
const char *env_wait;
- const Oid paramTypes[1] = {INT4OID};
+ char *query;
/*
* Wait for the connection to be idle, so that our check for an active
@@ -178,10 +178,21 @@ send_cancellable_query_impl(int line, PGconn *conn, PGconn *monitorConn)
if (env_wait == NULL)
env_wait = "180";
- if (PQsendQueryParams(conn, "SELECT pg_sleep($1)", 1, paramTypes,
- &env_wait, NULL, NULL, 0) != 1)
+ /*
+ * We cannot use PQsendQueryParams here because it uses the extended
+ * protocol to send the query. And it turns out there exists a race
+ * condition where would send the cancel request in between the Bind and
+ * Execute messages, resulting in the cancel request being ignored. So
+ * instead we build the query string client side and send it using
+ * PQsendQuery so there is only a single Query message.
+ */
+ query = psprintf("SELECT pg_sleep(%d)", atoi(env_wait));
+
+ if (PQsendQuery(conn, query) != 1)
pg_fatal_impl(line, "failed to send query: %s", PQerrorMessage(conn));
+ pfree(query);
+
/*
* Wait for the query to start, because if the query is not running yet
* the cancel request that we send won't have any effect.
base-commit: cc6e64afda530576d83e331365d36c758495a7cd
--
2.34.1
[application/octet-stream] v38-0003-Start-using-new-libpq-cancel-APIs.patch (10.7K, ../../CAGECzQQe9n8LCNzvAK08RzvYepKJMdc=2S0goQSuwD-eCS9wwQ@mail.gmail.com/3-v38-0003-Start-using-new-libpq-cancel-APIs.patch)
download | inline diff:
From e7773d8228307ffbb1a14c1ce017db2bc285fe4b Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <[email protected]>
Date: Thu, 14 Dec 2023 13:39:09 +0100
Subject: [PATCH v38 3/3] Start using new libpq cancel APIs
A previous commit introduced new APIs to libpq for cancelling queries.
This replaces the usage of the old APIs in most of the codebase with
these newer ones. This specifically leaves out changes to psql and
pgbench as those would need a much larger refactor to be able to call
them, due to the new functions not being signal-safe.
---
contrib/dblink/dblink.c | 30 +++--
contrib/postgres_fdw/connection.c | 105 +++++++++++++++---
.../postgres_fdw/expected/postgres_fdw.out | 15 +++
contrib/postgres_fdw/sql/postgres_fdw.sql | 7 ++
src/fe_utils/connect_utils.c | 11 +-
src/test/isolation/isolationtester.c | 29 ++---
6 files changed, 145 insertions(+), 52 deletions(-)
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 19a362526d2..98dcca3e6fd 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -1346,22 +1346,32 @@ PG_FUNCTION_INFO_V1(dblink_cancel_query);
Datum
dblink_cancel_query(PG_FUNCTION_ARGS)
{
- int res;
PGconn *conn;
- PGcancel *cancel;
- char errbuf[256];
+ PGcancelConn *cancelConn;
+ char *msg;
dblink_init();
conn = dblink_get_named_conn(text_to_cstring(PG_GETARG_TEXT_PP(0)));
- cancel = PQgetCancel(conn);
+ cancelConn = PQcancelCreate(conn);
- res = PQcancel(cancel, errbuf, 256);
- PQfreeCancel(cancel);
+ PG_TRY();
+ {
+ if (!PQcancelBlocking(cancelConn))
+ {
+ msg = pchomp(PQcancelErrorMessage(cancelConn));
+ }
+ else
+ {
+ msg = "OK";
+ }
+ }
+ PG_FINALLY();
+ {
+ PQcancelFinish(cancelConn);
+ }
+ PG_END_TRY();
- if (res == 1)
- PG_RETURN_TEXT_P(cstring_to_text("OK"));
- else
- PG_RETURN_TEXT_P(cstring_to_text(errbuf));
+ PG_RETURN_TEXT_P(cstring_to_text(msg));
}
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index 4931ebf5915..dcc13dc3b24 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -133,7 +133,7 @@ static void pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue);
static void pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry);
static void pgfdw_reset_xact_state(ConnCacheEntry *entry, bool toplevel);
static bool pgfdw_cancel_query(PGconn *conn);
-static bool pgfdw_cancel_query_begin(PGconn *conn);
+static bool pgfdw_cancel_query_begin(PGconn *conn, TimestampTz endtime);
static bool pgfdw_cancel_query_end(PGconn *conn, TimestampTz endtime,
bool consume_input);
static bool pgfdw_exec_cleanup_query(PGconn *conn, const char *query,
@@ -1315,36 +1315,104 @@ pgfdw_cancel_query(PGconn *conn)
endtime = TimestampTzPlusMilliseconds(GetCurrentTimestamp(),
CONNECTION_CLEANUP_TIMEOUT);
- if (!pgfdw_cancel_query_begin(conn))
+ if (!pgfdw_cancel_query_begin(conn, endtime))
return false;
return pgfdw_cancel_query_end(conn, endtime, false);
}
static bool
-pgfdw_cancel_query_begin(PGconn *conn)
+pgfdw_cancel_query_begin(PGconn *conn, TimestampTz endtime)
{
- PGcancel *cancel;
- char errbuf[256];
+ bool timed_out = false;
+ bool failed = false;
+ PGcancelConn *cancel_conn = PQcancelCreate(conn);
- /*
- * Issue cancel request. Unfortunately, there's no good way to limit the
- * amount of time that we might block inside PQgetCancel().
- */
- if ((cancel = PQgetCancel(conn)))
+
+ if (!PQcancelStart(cancel_conn))
{
- if (!PQcancel(cancel, errbuf, sizeof(errbuf)))
+ PG_TRY();
{
ereport(WARNING,
(errcode(ERRCODE_CONNECTION_FAILURE),
errmsg("could not send cancel request: %s",
- errbuf)));
- PQfreeCancel(cancel);
- return false;
+ pchomp(PQcancelErrorMessage(cancel_conn)))));
}
- PQfreeCancel(cancel);
+ PG_FINALLY();
+ {
+ PQcancelFinish(cancel_conn);
+ }
+ PG_END_TRY();
+ return false;
}
- return true;
+ /* In what follows, do not leak any PGcancelConn on an error. */
+ PG_TRY();
+ {
+ while (true)
+ {
+ TimestampTz now = GetCurrentTimestamp();
+ long cur_timeout;
+ PostgresPollingStatusType pollres = PQcancelPoll(cancel_conn);
+ int waitEvents = WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH;
+
+ if (pollres == PGRES_POLLING_OK)
+ {
+ break;
+ }
+
+ /* If timeout has expired, give up, else get sleep time. */
+ cur_timeout = TimestampDifferenceMilliseconds(now, endtime);
+ if (cur_timeout <= 0)
+ {
+ timed_out = true;
+ failed = true;
+ goto exit;
+ }
+
+ switch (pollres)
+ {
+ case PGRES_POLLING_READING:
+ waitEvents |= WL_SOCKET_READABLE;
+ break;
+ case PGRES_POLLING_WRITING:
+ waitEvents |= WL_SOCKET_WRITEABLE;
+ break;
+ default:
+ failed = true;
+ goto exit;
+ }
+
+ /* Sleep until there's something to do */
+ WaitLatchOrSocket(MyLatch, waitEvents, PQcancelSocket(cancel_conn),
+ cur_timeout, PG_WAIT_EXTENSION);
+ ResetLatch(MyLatch);
+
+ CHECK_FOR_INTERRUPTS();
+ }
+exit: ;
+ if (failed)
+ {
+ if (timed_out)
+ {
+ ereport(WARNING,
+ (errmsg("could not cancel request due to timeout")));
+ }
+ else
+ {
+ ereport(WARNING,
+ (errcode(ERRCODE_CONNECTION_FAILURE),
+ errmsg("could not send cancel request: %s",
+ pchomp(PQcancelErrorMessage(cancel_conn)))));
+ }
+ }
+ }
+ PG_FINALLY();
+ {
+ PQcancelFinish(cancel_conn);
+ }
+ PG_END_TRY();
+
+ return !failed;
}
static bool
@@ -1685,7 +1753,10 @@ pgfdw_abort_cleanup_begin(ConnCacheEntry *entry, bool toplevel,
*/
if (PQtransactionStatus(entry->conn) == PQTRANS_ACTIVE)
{
- if (!pgfdw_cancel_query_begin(entry->conn))
+ TimestampTz endtime = TimestampTzPlusMilliseconds(GetCurrentTimestamp(),
+ CONNECTION_CLEANUP_TIMEOUT);
+
+ if (!pgfdw_cancel_query_begin(entry->conn, endtime))
return false; /* Unable to cancel running query */
*cancel_requested = lappend(*cancel_requested, entry);
}
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index 58a603ac56f..e03160bd975 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -2739,6 +2739,21 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c
(10 rows)
ALTER VIEW v4 OWNER TO regress_view_owner;
+-- Make sure this big CROSS JOIN query is pushed down
+EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Foreign Scan
+ Output: (count(*))
+ Relations: Aggregate on ((((public.ft1) INNER JOIN (public.ft2)) INNER JOIN (public.ft4)) INNER JOIN (public.ft5))
+ Remote SQL: SELECT count(*) FROM ((("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (TRUE)) INNER JOIN "S 1"."T 3" r4 ON (TRUE)) INNER JOIN "S 1"."T 4" r6 ON (TRUE))
+(4 rows)
+
+-- Make sure query cancellation works
+SET statement_timeout = '10ms';
+select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long
+ERROR: canceling statement due to statement timeout
+RESET statement_timeout;
-- ====================================================================
-- Check that userid to use when querying the remote table is correctly
-- propagated into foreign rels present in subqueries under an UNION ALL
diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index e3d147de6da..2626e68cc69 100644
--- a/contrib/postgres_fdw/sql/postgres_fdw.sql
+++ b/contrib/postgres_fdw/sql/postgres_fdw.sql
@@ -737,6 +737,13 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c
SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10;
ALTER VIEW v4 OWNER TO regress_view_owner;
+-- Make sure this big CROSS JOIN query is pushed down
+EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5;
+-- Make sure query cancellation works
+SET statement_timeout = '10ms';
+select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long
+RESET statement_timeout;
+
-- ====================================================================
-- Check that userid to use when querying the remote table is correctly
-- propagated into foreign rels present in subqueries under an UNION ALL
diff --git a/src/fe_utils/connect_utils.c b/src/fe_utils/connect_utils.c
index 808d54461fd..5ed9f3ba17b 100644
--- a/src/fe_utils/connect_utils.c
+++ b/src/fe_utils/connect_utils.c
@@ -157,19 +157,14 @@ connectMaintenanceDatabase(ConnParams *cparams,
void
disconnectDatabase(PGconn *conn)
{
- char errbuf[256];
-
Assert(conn != NULL);
if (PQtransactionStatus(conn) == PQTRANS_ACTIVE)
{
- PGcancel *cancel;
+ PGcancelConn *cancelConn = PQcancelCreate(conn);
- if ((cancel = PQgetCancel(conn)))
- {
- (void) PQcancel(cancel, errbuf, sizeof(errbuf));
- PQfreeCancel(cancel);
- }
+ (void) PQcancelBlocking(cancelConn);
+ PQcancelFinish(cancelConn);
}
PQfinish(conn);
diff --git a/src/test/isolation/isolationtester.c b/src/test/isolation/isolationtester.c
index ed110f740f1..0b342b5c2bb 100644
--- a/src/test/isolation/isolationtester.c
+++ b/src/test/isolation/isolationtester.c
@@ -946,26 +946,21 @@ try_complete_step(TestSpec *testspec, PermutationStep *pstep, int flags)
*/
if (td > max_step_wait && !canceled)
{
- PGcancel *cancel = PQgetCancel(conn);
+ PGcancelConn *cancel_conn = PQcancelCreate(conn);
- if (cancel != NULL)
+ if (PQcancelBlocking(cancel_conn))
{
- char buf[256];
-
- if (PQcancel(cancel, buf, sizeof(buf)))
- {
- /*
- * print to stdout not stderr, as this should appear
- * in the test case's results
- */
- printf("isolationtester: canceling step %s after %d seconds\n",
- step->name, (int) (td / USECS_PER_SEC));
- canceled = true;
- }
- else
- fprintf(stderr, "PQcancel failed: %s\n", buf);
- PQfreeCancel(cancel);
+ /*
+ * print to stdout not stderr, as this should appear in
+ * the test case's results
+ */
+ printf("isolationtester: canceling step %s after %d seconds\n",
+ step->name, (int) (td / USECS_PER_SEC));
+ canceled = true;
}
+ else
+ fprintf(stderr, "PQcancel failed: %s\n", PQcancelErrorMessage(cancel_conn));
+ PQcancelFinish(cancel_conn);
}
/*
--
2.34.1
[application/octet-stream] v38-0002-Revert-Comment-out-noisy-libpq_pipeline-test.patch (931B, ../../CAGECzQQe9n8LCNzvAK08RzvYepKJMdc=2S0goQSuwD-eCS9wwQ@mail.gmail.com/4-v38-0002-Revert-Comment-out-noisy-libpq_pipeline-test.patch)
download | inline diff:
From 30c1302af63d852cc70163ee1b04343596121a9f Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <[email protected]>
Date: Thu, 14 Mar 2024 10:38:51 +0100
Subject: [PATCH v38 2/3] Revert "Comment out noisy libpq_pipeline test"
This reverts commit cc6e64afda530576d83e331365d36c758495a7cd.
---
src/test/modules/libpq_pipeline/libpq_pipeline.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/test/modules/libpq_pipeline/libpq_pipeline.c b/src/test/modules/libpq_pipeline/libpq_pipeline.c
index 83f9caca726..f7936ea2070 100644
--- a/src/test/modules/libpq_pipeline/libpq_pipeline.c
+++ b/src/test/modules/libpq_pipeline/libpq_pipeline.c
@@ -2109,10 +2109,7 @@ usage(const char *progname)
static void
print_test_list(void)
{
-#if 0
- /* Commented out until further stabilized */
printf("cancel\n");
-#endif
printf("disallowed_in_pipeline\n");
printf("multi_pipelines\n");
printf("nosync\n");
--
2.34.1
^ permalink raw reply [nested|flat] 29+ messages in thread
end of thread, other threads:[~2024-03-14 09:51 UTC | newest]
Thread overview: 29+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 18:33 [PATCH v4 12/12] comment typos Justin Pryzby <[email protected]>
2020-02-17 18:33 [PATCH v1 07/19] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/21] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2021-02-10 23:45 [PATCH 05/18] comment typos Justin Pryzby <[email protected]>
2023-01-15 23:00 [PATCH 02/10] comment typos Justin Pryzby <[email protected]>
2024-03-13 19:00 Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Alvaro Herrera <[email protected]>
2024-03-13 19:08 ` Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Jacob Champion <[email protected]>
2024-03-14 09:51 ` Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Jelte Fennema-Nio <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox