Re: Add client connection check during the execution of the query

2021-03-29 Thread Maksim Milyutin
gey. * Concerns about portability of `pq_check_connection()`A implementation. BTW, on windows postgres with this patch have not been built [1]. * Absence of benchmark results to show lack of noticeable performance regression after applying non-zero timeout for checking client liveness. 1. https:/

Re: Add client connection check during the execution of the query

2021-10-11 Thread Maksim Milyutin
OCKET_CLOSED value under calling of pq_check_connection() function doesn't have negative impact later, does it? That is, all WaitEventSetWait() calls have to setup socket events on its own from scratch. -- Regards, Maksim Milyutin

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2019-03-19 Thread Maksim Milyutin
ements and consider such computing of queryId as canonical. -- Regards, Maksim Milyutin

Re: [HACKERS] wrong t_bits alignment in pageinspect

2018-01-04 Thread Maksim Milyutin
Hi! 02.01.2018 12:33, Andrey Borodin wrote: 15 дек. 2017 г., в 18:53, Maksim Milyutin написал(а): I found out the problem in exposing values of t_bits field from heap_page_items function. Probably, this [0] place contains similar bug too? [0] https://github.com/postgres/postgres/blob

Re: [HACKERS] PoC: custom signal handler for extensions

2018-01-22 Thread Maksim Milyutin
ion. I have attached a new version of patch and updated version of remote_effective_user function implementation that demonstrates the usage of custom signals API. 1. https://github.com/postgrespro/pg_query_state -- Regards, Maksim Milyutin diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/sto

Re: [HACKERS] PoC: custom signal handler for extensions

2018-01-22 Thread Maksim Milyutin
Since these checks is not expensive it will be good to replace their to ereport calls. Updated patch is attached in [1]. 1. https://www.postgresql.org/message-id/37a48ac6-aa14-4e36-5f08-cf8581fe1382%40gmail.com -- Regards, Maksim Milyutin

Re: Disallow cancellation of waiting for synchronous replication

2019-12-25 Thread Maksim Milyutin
cd/B28359_01/server.111/b28326/repmaster.htm#i33607 -- Best regards, Maksim Milyutin

Re: Disallow cancellation of waiting for synchronous replication

2019-12-25 Thread Maksim Milyutin
is enabled. Yes, at query canceling (e.g. by timeout from client driver) client receives response about completed transaction (though with warning which not all client drivers can handle properly) and the guarantee about successfully replicated transaction *violates*. -- Best regards, Maksim Milyutin

Re: Disallow cancellation of waiting for synchronous replication

2019-12-25 Thread Maksim Milyutin
On 25.12.2019 14:27, Marco Slot wrote: On Wed, Dec 25, 2019, 11:28 Maksim Milyutin <mailto:milyuti...@gmail.com>> wrote: But in this case locally committed data becomes visible to new incoming transactions that is bad side-effect of this issue. Your application

Re: Disallow cancellation of waiting for synchronous replication

2019-12-26 Thread Maksim Milyutin
On 25.12.2019 13:45, Andrey Borodin wrote: 25 дек. 2019 г., в 15:28, Maksim Milyutin написал(а): Synchronous replication does not guarantee that a committed write is actually on any replica, but it does in general guarantee that a commit has been replicated before sending a response to the

Re: Disallow cancellation of waiting for synchronous replication

2019-12-28 Thread Maksim Milyutin
rough changing of synchronous_standby_names). In first case he explicitly agrees with existence of local (not replicated) commits in master. -- Best regards, Maksim Milyutin

Re: Disallow cancellation of waiting for synchronous replication

2020-01-15 Thread Maksim Milyutin
which standby will be promoted. -- Best regards, Maksim Milyutin

Re: [HACKERS] PoC: custom signal handler for extensions

2018-03-05 Thread Maksim Milyutin
without preload initialization. Do you know when you'll have an updated patch available? I want to actuate the work on this patch for the next 12 release. Sorry, for now I can not keep up with the current release. -- Regards, Maksim Milyutin

Re: Synchronous commit behavior during network outage

2021-04-20 Thread Maksim Milyutin
rning have to be accounted here and performed commit have not to be treated as *successful*. 1. https://www.postgresql.org/message-id/C1F7905E-5DB2-497D-ABCC-E14D4DEE506C%40yandex-team.ru 2. https://www.postgresql.org/message-id/CANtu0ogbu%2By6Py963p-zKJ535b8zm5AOq7zkX7wW-tryPYi1DA%40mail.gmail.com -- Regards, Maksim Milyutin

Re: Synchronous commit behavior during network outage

2021-04-20 Thread Maksim Milyutin
ved commit message make it not *successful*? I think we have to explicitly mention cases about cancellation and termination session in docs to avoid ambiguity in understanding of phrase above. 1. https://www.postgresql.org/docs/current/warm-standby.html#SYNCHRONOUS-REPLICATION-HA -- Regards, Maksim Milyutin

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-14 Thread Maksim Milyutin
result; +} Hi, Thomas! Should not we call at the end the StrategyFreeBuffer() function to add target buffer to freelist and not miss it after invalidation? -- Best regards, Maksim Milyutin

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-29 Thread Maksim Milyutin
On 14.04.2024 21:16, Maksim Milyutin wrote: On 07.04.2024 02:07, Thomas Munro wrote: So this is the version I plan to commit. +bool +EvictUnpinnedBuffer(Buffer buf) +{ ... +/* This will return false if it becomes dirty or someone else pins it. */ +result = InvalidateVictimBuffer(desc

Re: Extension Enhancement: Buffer Invalidation in pg_buffercache

2024-04-29 Thread Maksim Milyutin
On 29.04.2024 23:59, Thomas Munro wrote: On Tue, Apr 30, 2024 at 7:17 AM Thomas Munro wrote: On Tue, Apr 30, 2024 at 6:47 AM Maksim Milyutin wrote: Should not we call at the end the StrategyFreeBuffer() function to add target buffer to freelist and not miss it after invalidation? Please

Re: O_DIRECT for relations and SLRUs (Prototype)

2019-01-15 Thread Maksim Milyutin
t's just a lazy implementation. Hi! Could you specify all cases when buffers will not be aligned with BLCKSZ? AFAIC shared and temp buffers are aligned. And what ones are not? -- Regards, Maksim Milyutin

Re: Slow planning time for simple query

2018-06-13 Thread Maksim Milyutin
On 09.06.2018 22:49, Tom Lane wrote: Maksim Milyutin writes: On hot standby I faced with the similar problem. ... is planned 4.940 ms on master and *254.741* ms on standby. (I wonder though why, if you executed the same query on the master, its setting of the index-entry-is-dead bits didn&#

Re: Slow planning time for simple query

2018-06-13 Thread Maksim Milyutin
13.06.2018 12:40, Maksim Milyutin wrote: On 09.06.2018 22:49, Tom Lane wrote: Maksim Milyutin writes: On hot standby I faced with the similar problem. ... is planned 4.940 ms on master and *254.741* ms on standby. (I wonder though why, if you executed the same query on the master, its

Re: [HACKERS] Add support for tuple routing to foreign partitions

2017-12-12 Thread Maksim Milyutin
rgetlist references root->parse, it's needed to replace that with the child query before calling that function, but I forgot to do that.  So I fixed that.  Attached is an updated version of the patch. Your patch already is not applied on master. Please rebase it. -- Regards, Maksim Milyutin

[HACKERS] wrong t_bits alignment in pageinspect

2017-12-15 Thread Maksim Milyutin
| \xf100 I suppose the prefix 1001 corresponds to real value of t_bits, the rest part 1000 - to the lower byte of f1 field of tbl. Attached patch fixes this issue. -- Regards, Maksim Milyutin diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapf

[HACKERS] PoC: custom signal handler for extensions

2017-12-22 Thread Maksim Milyutin
extension side. The simple RPC that defines effective userid on remote backend (remote_effective_user function) is attached for example. C&C welcome! -- Regards, Maksim Milyutin diff --git a/src/backend/storage/ipc/procsignal.c b/src/backend/storage/ipc/procsignal.c index b9302ac630..75d4ea

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-22 Thread Maksim Milyutin
is mechanism for log of executed plan or full query? This idea (but without logging) is implemented in the work on pg_progress command proposed by Remi Colinet[1] and in extension pg_query_state[2]. 1. https://www.postgresql.org/message-id/CADdR5nxQUSh5kCm9MKmNga8%2Bc1JLxLHDzLhAyXpfo9-Wmc6s5g%40mail.gmail.com 2. https://github.com/postgrespro/pg_query_state -- Regards, Maksim Milyutin

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-22 Thread Maksim Milyutin
On 22.12.2017 16:56, Craig Ringer wrote: On 22 December 2017 at 20:50, Maksim Milyutin <mailto:milyuti...@gmail.com>> wrote: On 19.12.2017 16:54, Pavel Stehule wrote: sorry for small offtopic. Can be used this mechanism for log of executed plan or full query? That&#

Re: PoC: custom signal handler for extensions

2017-12-23 Thread Maksim Milyutin
s core. -- Regards, Maksim Milyutin

Re: Using ProcSignal to get memory context stats from a running backend

2017-12-27 Thread Maksim Milyutin
On 27.12.2017 10:44, Craig Ringer wrote: On 22 December 2017 at 23:19, Maksim Milyutin <mailto:milyuti...@gmail.com>> wrote: Noticing the interest in the calling some routines on the remote backend through signals, in parallel thread[1] I have proposed the possibility

Hint to set owner for tablespace directory

2018-08-23 Thread Maksim Milyutin
owner for the tablespace directory if this is the cause of the problem (*errno == EPERM* after calling *chmod*). -- Regards, Maksim Milyutin diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index f7e9160..a8733d4 100644 --- a/src/backend/commands/tablespace.c

Re: Hint to set owner for tablespace directory

2018-08-24 Thread Maksim Milyutin
On 08/24/2018 05:18 AM, Michael Paquier wrote: On Thu, Aug 23, 2018 at 02:24:25PM +0300, Maksim Milyutin wrote: I want to add patch that prints hint to set required owner for the tablespace directory if this is the cause of the problem (*errno == EPERM* after calling *chmod*). Please do not

Re: Hint to set owner for tablespace directory

2018-08-31 Thread Maksim Milyutin
iff --check* doesn't print any warnings. -- Regards, Maksim Milyutin

Re: Hint to set owner for tablespace directory

2018-08-31 Thread Maksim Milyutin
On 08/31/2018 01:12 PM, Rafia Sabih wrote: On Fri, Aug 31, 2018 at 3:30 PM, Maksim Milyutin <mailto:milyuti...@gmail.com>> wrote: On 08/31/2018 11:55 AM, Rafia Sabih wrote: Adding to that this patch needs a rebase. And, please don't forget to run 'git diff

Re: Hint to set owner for tablespace directory

2018-08-31 Thread Maksim Milyutin
30.08.2018 19:52, Peter Eisentraut wrote: On 23/08/2018 13:24, Maksim Milyutin wrote: I have noticed the novice users are stuck trying to create tablespace over a directory whose owner is not the system postgres user. They observed the message "could not set permissions on dire

Re: Hint to set owner for tablespace directory

2018-09-07 Thread Maksim Milyutin
On 08/31/2018 04:59 PM, Tom Lane wrote: Maksim Milyutin writes: 30.08.2018 19:52, Peter Eisentraut wrote: I think the hint is backwards. When you don't have permission to chmod the tablespace directory, you probably want to fix the permissions on the tablespace directory or its parent

Re: Hint to set owner for tablespace directory

2018-09-07 Thread Maksim Milyutin
On 09/07/2018 06:05 PM, Peter Eisentraut wrote: On 07/09/2018 11:59, Maksim Milyutin wrote: OK. However I think it would be helpful to leave the mention about setting necessary owner for tablespace directory. My final version of hint is "You might need to fix permissions on this directo

Re: Hint to set owner for tablespace directory

2018-10-01 Thread Maksim Milyutin
01.10.2018 15:15, Peter Eisentraut wrote: On 24/09/2018 14:50, Peter Eisentraut wrote: On 11/09/2018 17:10, Peter Eisentraut wrote: On 07/09/2018 17:59, Maksim Milyutin wrote: those directories was that user). The error message "could not set permissions on directory ..." disori

COALESCE with single argument looks like identity function

2025-04-11 Thread Maksim Milyutin
from some expression like converging OUTER JOIN to INNER one with WHERE qual containing COALESCE over single column from inner side. The patch of transformation in question for COALESCE is attached. -- Best regard, Maksim Milyutin From 1287610efa3895a0ababfc66f346a6a7c7edf9b9 Mon Sep 17 00:00:00

Re: COALESCE with single argument looks like identity function

2025-04-14 Thread Maksim Milyutin
On 4/11/25 17:00, Tom Lane wrote: Maksim Milyutin writes: I've noticed that COALESCE function doesn't converge to argument expression if it is alone in argument list of COALESCE as part simplification routine for expressions in planner. This might suppress further useful transforma

Re: COALESCE with single argument looks like identity function

2025-04-14 Thread Maksim Milyutin
Updated patchset is attached On 4/14/25 17:25, Maksim Milyutin wrote: On 4/11/25 17:00, Tom Lane wrote: Maksim Milyutin writes: I've noticed that COALESCE function doesn't converge to argument expression if it is alone in argument list of COALESCE as part simplification r