RE: logical replication empty transactions

2022-03-01 Thread shiy.f...@fujitsu.com
Hi, Here are some comments on the v21 patch. 1. + WalSndKeepalive(false, 0); Maybe we can use InvalidXLogRecPtr here, instead of 0. 2. + pq_sendint64(&output_message, writePtr ? writePtr : sentPtr); Similarly, should we use XLogRecPtrIsInvalid()? 3. @@ -1183,6 +126

RE: Failed transaction statistics to measure the logical replication progress

2022-03-02 Thread shiy.f...@fujitsu.com
Hi, A comments on the v26 patch. The following document about pg_stat_subscription_stats view only says that "showing statistics about errors", should we add something about transactions here? pg_stat_subscription_statspg_stat_subscription_stats One row per subscription, show

RE: row filtering for logical replication

2022-03-02 Thread shiy.f...@fujitsu.com
On Thu, Mar 3, 2022 10:40 AM Amit Kapila wrote: > > On Wed, Mar 2, 2022 at 5:42 PM Euler Taveira wrote: > > > > On Wed, Mar 2, 2022, at 8:45 AM, Tomas Vondra wrote: > > > > While working on the column filtering patch, which touches about the > > same places, I noticed two minor gaps in testing:

RE: Optionally automatically disable logical replication subscriptions on error

2022-03-06 Thread shiy.f...@fujitsu.com
On Wed, Mar 2, 2022 5:39 PM osumi.takami...@fujitsu.com wrote: > > Attached an updated patch v26. > Thanks for your patch. A comment on the document. @@ -7771,6 +7771,16 @@ SCRAM-SHA-256$:&l + subdisableonerr bool + + + If true, the s

RE: logical replication empty transactions

2022-03-07 Thread shiy.f...@fujitsu.com
On Fri, Mar 4, 2022 9:41 AM Ajin Cherian wrote: > > I have split the patch into two. I have kept the logic of skipping > streaming changes in the second patch. > I will work on the second patch once we can figure out a solution for > the COMMIT PREPARED after restart problem. > Thanks for updat

RE: Skipping logical replication transactions on subscriber side

2022-03-14 Thread shiy.f...@fujitsu.com
On Fri, Mar 11, 2022 4:20 PM Masahiko Sawada wrote: > > I've attached an updated version patch. This patch can be applied on > top of the latest disable_on_error patch[1]. > Thanks for your patch. Here are some comments for the v13 patch. 1. doc/src/sgml/ref/alter_subscription.sgml +

RE: Column Filtering in Logical Replication

2022-03-14 Thread shiy.f...@fujitsu.com
On Mon, Mar 14, 2022 5:08 AM Tomas Vondra wrote: > > On 3/12/22 05:30, Amit Kapila wrote: > >> ... > > > > Okay, please find attached. I have done basic testing of this, if we > > agree with this approach then this will require some more testing. > > > > Thanks, the proposed changes seem like a

RE: Skipping logical replication transactions on subscriber side

2022-03-16 Thread shiy.f...@fujitsu.com
On Wed, Mar 16, 2022 4:23 PM Masahiko Sawada wrote: > > I've attached an updated version patch. > Thanks for updating the patch. Here are some comments for the v15 patch. 1. src/backend/replication/logical/worker.c + * to skip applying the changes when starting to apply changes. The subskip

RE: Table refer leak in logical replication

2021-04-05 Thread shiy.f...@fujitsu.com
> BTW, it seems better to add a testcase for this ? I think the test for it can be added in src/test/subscription/t/003_constraints.pl, which is like what in my patch. Regards, Shi yu tests_for_table_refer_leak.diff Description: tests_for_table_refer_leak.diff

RE: psql - add SHOW_ALL_RESULTS option

2021-04-07 Thread shiy.f...@fujitsu.com
Hi I met a problem after commit 3a51306722. While executing a SQL statement with psql, I can't interrupt it by pressing ctrl+c. For example: postgres=# insert into test select generate_series(1,1000); ^C^CINSERT 0 1000 Press ctrl+c before finishing INSERT, and psql still continuing t

RE: psql - add SHOW_ALL_RESULTS option

2021-04-07 Thread shiy.f...@fujitsu.com
> Attached a patch which attempts to fix this by moving the cancellation > cancelling request after processing results. Thank you for your fixing. I tested and the problem has been solved after applying your patch. Regards, Shi yu

RE: Could you help testing logical replication?

2021-04-12 Thread shiy.f...@fujitsu.com
> Then I get timeout error occurs and the subscriber worker keep re-launching > over and over (you did not mention see such errors?) I test again and get errors, too. I didn't check log after timeout in the previous test. Regards, Tang

RE: Could you help testing logical replication?

2021-04-12 Thread shiy.f...@fujitsu.com
Sorry for sending a wrong mail. Please ignore it. > -Original Message- > From: Shi, Yu/侍 雨 > Sent: Monday, April 12, 2021 6:51 PM > To: Tang, Haiying/唐 海英 > Cc: pgsql-hackers@lists.postgresql.org > Subject: RE: Could you help testing logical replication? > > > Then I get timeout error o

撤回: Could you help testing logical replication?

2021-04-12 Thread shiy.f...@fujitsu.com
Shi, Yu/侍 雨 将撤回邮件“Could you help testing logical replication?”。

撤回: Could you help testing logical replication?

2021-04-12 Thread shiy.f...@fujitsu.com
Shi, Yu/侍 雨 将撤回邮件“Could you help testing logical replication?”。

RE: Data is copied twice when specifying both child and parent table in publication

2021-10-21 Thread shiy.f...@fujitsu.com
On Tuesday, October 19, 2021 10:47 AM houzj.f...@fujitsu.com wrote: > > On Monday, October 18, 2021 5:03 PM Amit Langote > wrote: > > I can imagine that the behavior seen here may look surprising, but not > > sure if I would call it a bug as such. I do remember thinking about > > this case and

RE: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-22 Thread shiy.f...@fujitsu.com
On Wed, Feb 22, 2023 2:20 PM Michael Paquier wrote: > > On Wed, Feb 22, 2023 at 12:07:06PM +0900, Kyotaro Horiguchi wrote: > > At Wed, 22 Feb 2023 12:29:59 +1100, Peter Smith > wrote in > >> If you are going to do that, then won't just copying the > >> CacheRegisterSyscacheCallback(PUBLICATIONOI

RE: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-23 Thread shiy.f...@fujitsu.com
On Wed, Feb 22, 2023 9:48 PM Kuroda, Hayato/黒田 隼人 wrote: > > Thank you for reviewing! PSA new version. > Thanks for your patch. Here is a comment. + elog(DEBUG2, "time-delayed replication for txid %u, delay_time = %d ms, remaining wait time: %ld ms", +ct

RE: Allow logical replication to copy tables in binary format

2023-02-23 Thread shiy.f...@fujitsu.com
On Thu, Feb 23, 2023 12:40 PM Kuroda, Hayato/黒田 隼人 wrote: > > > > I'm not sure the combination of "copy_format = binary" and "copy_data = > false" > > > should be accepted or not. How do you think? > > > > It seems quite useless indeed to specify the format of a copy that won't > happen. > > I

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-02 Thread shiy.f...@fujitsu.com
On Wed, Mar 1, 2023 9:22 PM Önder Kalacı wrote: > > Hi Andres, Amit, Shi Yu, all > > Andres Freund , 28 Şub 2023 Sal, 21:39 tarihinde > şunu yazdı: > Hi, > > On 2023-02-25 16:00:05 +0530, Amit Kapila wrote: > > On Tue, Feb 21, 2023 at 7:55 PM Önder Kalacı

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-06 Thread shiy.f...@fujitsu.com
On Monay, Mar 6, 2023 7:19 PM Önder Kalacı wrote: > > Yeah, seems easier to follow to me as well. Reflected it in the comment as > well. > Thanks for updating the patch. Here are some comments on v33-0001 patch. 1. + if (RelationReplicaIdentityFullIndexScanEnabled(localrel) && +

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-07 Thread shiy.f...@fujitsu.com
On Tue, Mar 7, 2023 9:47 PM Önder Kalacı wrote: > > I'm attaching v35. > I noticed that if the index column only exists on the subscriber side, this index can also be chosen. This seems a bit odd because the index column isn't sent from publisher. e.g. -- pub CREATE TABLE test_replica_id_ful

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-12 Thread shiy.f...@fujitsu.com
On Fri, Mar 10, 2023 8:17 PM Amit Kapila wrote: > > On Fri, Mar 10, 2023 at 5:16 PM Önder Kalacı wrote: > > > >> > >> wip_for_optimize_index_column_match > >> +static bool > >> +IndexContainsAnyRemoteColumn(IndexInfo *indexInfo, > >> + LogicalRepRelation *remoterel) > >> +{ > >> + for (int i =

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-13 Thread shiy.f...@fujitsu.com
On Sun, Mar 12, 2023 4:00 AM Önder Kalacı wrote: > > Attaching a patch that could possibly solve the problem. > Thanks for your patch. I tried it and it worked well. Here are some minor comments. 1. @@ -243,6 +243,17 @@ tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2,

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-03-13 Thread shiy.f...@fujitsu.com
On Mon, Mar 13, 2023 10:16 PM Önder Kalacı wrote: > > Attaching v47. > Thanks for updating the patch. Here are some comments. 1. in RemoteRelContainsLeftMostColumnOnIdx(): + if (indexInfo->ii_NumIndexAttrs < 1) + return false; Did you see any cases that the condition is t

RE: Allow logical replication to copy tables in binary format

2023-03-15 Thread shiy.f...@fujitsu.com
On Thu, Mar 16, 2023 2:26 AM Melih Mutlu wrote: > > Right, it needs to be ordered. Fixed. > Hi, Thanks for updating the patch. I tested some cases like toast data, combination of row filter and column lists, and it works well. Here is a comment: +# Ensure the COPY command is executed in bina

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-16 Thread shiy.f...@fujitsu.com
On Thu, Mar 16, 2023 5:23 PM Amit Kapila wrote: > > On Mon, Mar 13, 2023 at 6:26 PM Önder Kalacı > wrote: > > > > Attaching v2 > > > > Can we change the comment to: "Ignore dropped and generated columns as > the publisher doesn't send those."? After your change, att = > TupleDescAttr(slot1->tts

RE: Allow logical replication to copy tables in binary format

2023-03-16 Thread shiy.f...@fujitsu.com
On Thu, Mar 16, 2023 9:20 PM Melih Mutlu wrote: > > Hi, > > Please see the attached v16. > Thanks for updating the patch. +# Cannot sync due to type mismatch +$node_subscriber->wait_for_log(qr/ERROR: ( [A-Z0-9]+:)? incorrect binary data format/); +# Ensure the COPY command is executed in t

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-17 Thread shiy.f...@fujitsu.com
On Friday, March 17, 2023 3:38 PM Önder Kalacı wrote: > > Hi Amit, all > > You can first submit the fix for dropped columns with patches till > v10. Once that is committed, then you can send the patches for > generated columns. > > Alright, attaching 2 patches for dropped columns, the names of

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-20 Thread shiy.f...@fujitsu.com
On Fri, Mar 17, 2023 11:29 PM Önder Kalacı wrote: > > Thanks for sharing. Fixed > > > This time I was able to run all the tests with all the patches applied. > > Again, the generated column fix also has some minor differences > per version. So, overall we have 6 patches with very minor > diff

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-21 Thread shiy.f...@fujitsu.com
On Tue, Mar 21, 2023 4:51 PM Önder Kalacı wrote: > > Hi Amit, Shi Yu > > Now attaching the similar patches for generated columns. > Thanks for your patches. Here are some comments. 1. $node_publisher->safe_psql( 'postgres', qq( ALTER TABLE dropped_cols DROP COLUMN b_d

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-21 Thread shiy.f...@fujitsu.com
On Tuesday, March 21, 2023 8:03 PM Önder Kalacı wrote: > > Attached patches again. > Thanks for updating the patch. @@ -408,15 +412,18 @@ $node_subscriber->wait_for_subscription_sync; $node_publisher->safe_psql( 'postgres', qq( ALTER TABLE dropped_cols DROP COLUMN b_dr

RE: Allow logical replication to copy tables in binary format

2023-03-21 Thread shiy.f...@fujitsu.com
On Wed Mar 22, 2023 7:29 AM Peter Smith wrote: > > Thanks for all the patch updates. Patch v19 LGTM. > +1 Regards, Shi Yu

RE: Dropped and generated columns might cause wrong data on subs when REPLICA IDENTITY FULL

2023-03-22 Thread shiy.f...@fujitsu.com
On Wed, Mar 22, 2023 2:53 PM Önder Kalacı wrote: > > We don't really need to, if you check the first patch, we don't have DROP for > generated case. I mostly > wanted to make the test a little more interesting, but it also seems to be a > little confusing. > > Now attaching v2 where we do not

RE: Force streaming every change in logical decoding

2022-12-14 Thread shiy.f...@fujitsu.com
On Sat, Dec 10, 2022 2:03 PM Dilip Kumar wrote: > > On Tue, Dec 6, 2022 at 11:53 AM shiy.f...@fujitsu.com > wrote: > > > > Hi hackers, > > > > In logical decoding, when logical_decoding_work_mem is exceeded, the > changes are > > sent to outpu

RE: Force streaming every change in logical decoding

2022-12-21 Thread shiy.f...@fujitsu.com
On Wed, Dec 21, 2022 4:54 PM Amit Kapila wrote: > > On Wed, Dec 21, 2022 at 1:55 PM Peter Smith > wrote: > > > > On Wed, Dec 21, 2022 at 6:22 PM Masahiko Sawada > wrote: > > > > > > On Tue, Dec 20, 2022 at 7:49 PM Amit Kapila > wrote: > > > > > > > > On Tue, Dec 20, 2022 at 2:46 PM Hayato Kuro

RE: Force streaming every change in logical decoding

2022-12-21 Thread shiy.f...@fujitsu.com
On Wed, Dec 21, 2022 4:05 PM Peter Smith wrote: > > Here are some review comments for patch v2. > > Since the GUC is still under design maybe these comments can be > ignored for now, but I guess similar comments will apply in future > anyhow (just with some name changes). > Thanks for your com

RE: Force streaming every change in logical decoding

2022-12-22 Thread shiy.f...@fujitsu.com
On Thu, Dec 22, 2022 5:24 PM Amit Kapila wrote: > > On Thu, Dec 22, 2022 at 1:15 PM Kyotaro Horiguchi > wrote: > > > > At Thu, 22 Dec 2022 12:35:46 +0530, Amit Kapila > wrote in > > > I have addressed these comments in the attached. Additionally, I have > > > modified the docs and commit messag

RE: Force streaming every change in logical decoding

2022-12-23 Thread shiy.f...@fujitsu.com
On Fri, Dec 23, 2022 1:50 PM Amit Kapila > > On Thu, Dec 22, 2022 at 6:18 PM shiy.f...@fujitsu.com > wrote: > > > > > > Besides, I tried to reduce data size in streaming subscription tap tests by > > this > > new GUC (see 0002 patch). But I didn'

Ignore dropped columns when checking the column list in logical replication

2023-01-03 Thread shiy.f...@fujitsu.com
Hi hackers, I saw a problem related to column list. There's a restriction that different column lists for same table can't be used in the publications of single subscription. But we will get unexpected errors in some cases because the dropped columns are not ignored. For example: -- publisher cr

RE: Force streaming every change in logical decoding

2023-01-05 Thread shiy.f...@fujitsu.com
On Thu, Dec 22, 2022 3:17 PM Masahiko Sawada wrote: > > I think > > instead of adding new tests with this patch, it may be better to > > change some of the existing tests related to streaming to use this > > parameter as that will clearly show one of the purposes of this patch. > > +1. I think t

Fix pg_publication_tables to exclude generated columns

2023-01-09 Thread shiy.f...@fujitsu.com
Hi hackers, I noticed that there is a problem about system view pg_publication_tables when looking into [1]. The column "attnames" contains generated columns when no column list is specified, but generated columns shouldn't be included because they are not replicated (see send_relation_and_attrs()

RE: Fix pg_publication_tables to exclude generated columns

2023-01-09 Thread shiy.f...@fujitsu.com
On Mon, Jan 9, 2023 11:06 PM Tom Lane wrote: > > Amit Kapila writes: > > On Mon, Jan 9, 2023 at 5:29 PM shiy.f...@fujitsu.com > > wrote: > >> I think one way to fix it is to modify pg_publication_tables query to > >> exclude > >> generated colu

RE: Allow logical replication to copy tables in binary format

2023-01-11 Thread shiy.f...@fujitsu.com
On Mon, Nov 14, 2022 8:08 PM Melih Mutlu wrote: > > Attached patch with updated version of this patch. Thanks for your patch. I tried to do a performance test for this patch, the result looks good to me. (The steps are similar to what Melih shared [1].) The time to synchronize about 1GB data in

RE: Fix pg_publication_tables to exclude generated columns

2023-01-11 Thread shiy.f...@fujitsu.com
On Wed, Jan 11, 2023 2:40 PM Amit Kapila wrote: > > On Wed, Jan 11, 2023 at 10:07 AM Tom Lane wrote: > > > > Amit Kapila writes: > > >> On Mon, Jan 9, 2023 11:06 PM Tom Lane wrote: > > >>> We could just not fix it in the back branches. I'd argue that this is > > >>> as much a definition chang

RE: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-01-16 Thread shiy.f...@fujitsu.com
On Wed, Jan 11, 2023 4:31 PM Melih Mutlu wrote: > > Hi hackers, > > Rebased the patch to resolve conflicts. > Thanks for your patch. Here are some comments. 0001 patch 1. walsender.c + /* Create a tuple to send consisten WAL location */ "consisten" should be "consistent" I

Update comments in multixact.c

2023-01-17 Thread shiy.f...@fujitsu.com
Hi, I noticed that commit 5212d447fa updated some comments in multixact.c because SLRU truncation for multixacts is performed during VACUUM, instead of checkpoint. Should the following comments which mentioned checkpointer be changed, too? 1. * we compute it (using nextMXact if none are valid).

RE: Update comments in multixact.c

2023-01-18 Thread shiy.f...@fujitsu.com
On Wed, Jan 18, 2023 6:04 AM Peter Geoghegan wrote: > > On Tue, Jan 17, 2023 at 1:33 AM shiy.f...@fujitsu.com > wrote: > > I noticed that commit 5212d447fa updated some comments in multixact.c > because > > SLRU truncation for multixacts is performed during VACUUM, i

RE: Data is copied twice when specifying both child and parent table in publication

2023-03-31 Thread shiy.f...@fujitsu.com
On Fri, Mar 31, 2023 2:16 AM Jacob Champion wrote: > > On Wed, Mar 29, 2023 at 2:00 AM Amit Kapila > wrote: > > Pushed. > > While rebasing my logical-roots patch over the top of this, I ran into > another situation where mixed viaroot settings can duplicate data. The > key idea is to subscribe

RE: logical replication empty transactions

2022-03-23 Thread shiy.f...@fujitsu.com
On Thursday, March 24, 2022 11:19 AM Hou, Zhijie/侯 志杰 wrote: > > Attach the new version patch which include the following changes: > > - Fix a typo > - Change the requestreply flag of the newly added WalSndKeepalive to false, > because the subscriber can judge whether it's necessary to post a

RE: logical replication empty transactions

2022-03-29 Thread shiy.f...@fujitsu.com
On Tue, Mar 29, 2022 5:15 PM Hou, Zhijie/侯 志杰 wrote: > > Thanks for the comment. > Attach the new version patch with this change. > Hi, I did a performance test for this patch to see if it affects performance when publishing empty transactions, based on the v32 patch. In this test, I use sync

RE: Logical replication timeout problem

2022-03-30 Thread shiy.f...@fujitsu.com
On Wed, Mar 30, 2022 3:54 PM wangw.f...@fujitsu.com wrote: > > Rebase the patch because the commit d5a9d86d in current HEAD. > Thanks for your patch, I tried this patch and confirmed that there is no timeout problem after applying this patch, and I could reproduce this problem on HEAD. Regard

RE: Skipping schema changes in publication

2022-04-14 Thread shiy.f...@fujitsu.com
On Tue, Apr 12, 2022 2:23 PM vignesh C wrote: > > The patch does not apply on top of HEAD because of the recent commit, > attached patch is rebased on top of HEAD. > Thanks for your patch. Here are some comments for 0001 patch. 1. doc/src/sgml/catalogs.sgml @@ -6438,6 +6438,15 @@ SCRAM-SHA-256

RE: Data is copied twice when specifying both child and parent table in publication

2022-04-19 Thread shiy.f...@fujitsu.com
On Tue, Apr 19, 2022 3:05 PM houzj.f...@fujitsu.com wrote: > > > -Original Message- > > From: Wang, Wei/王 威 > On Thursday, April 7, 2022 11:08 AM > > > > On Thur, Mar 10, 2021 at 10:08 AM houzj.f...@fujitsu.com wrote: > > > Hi, > > > > > > When reviewing some logical replication related

RE: Data is copied twice when specifying both child and parent table in publication

2022-04-27 Thread shiy.f...@fujitsu.com
On Sun, Apr 24, 2022 2:16 PM Wang, Wei/王 威 wrote: > > Attach the new patches.[suggestions by Amit-San] > The patch for HEAD: > 1. Add a new function to get tables info by a publications array. > The patch for REL14: > 1. Use an alias to make the statement understandable. BTW, I adjusted the > ali

RE: Fix some newly modified tab-complete changes

2022-11-16 Thread shiy.f...@fujitsu.com
On Thu, Nov 10, 2022 12:54 PM Michael Paquier wrote: > > On Tue, Oct 18, 2022 at 05:17:32PM +1100, Peter Smith wrote: > > I re-tested and confirm that the patch does indeed fix the quirk I'd > > previously reported. > > > > But, looking at the patch code, I don't know if it is the best way to > >

RE: Avoid streaming the transaction which are skipped (in corner cases)

2022-11-28 Thread shiy.f...@fujitsu.com
On Sun, Nov 27, 2022 1:33 PM Dilip Kumar wrote: > > On Sat, Nov 26, 2022 at 12:15 PM Amit Kapila > wrote: > > > > On Fri, Nov 25, 2022 at 5:38 PM Amit Kapila > wrote: > > > > > > On Fri, Nov 25, 2022 at 1:35 PM Dilip Kumar > wrote: > > > > > > > > During DecodeCommit() for skipping a transacti

Force streaming every change in logical decoding

2022-12-05 Thread shiy.f...@fujitsu.com
Hi hackers, In logical decoding, when logical_decoding_work_mem is exceeded, the changes are sent to output plugin in streaming mode. But there is a restriction that the minimum value of logical_decoding_work_mem is 64kB. I tried to add a GUC to allow sending every change to output plugin without

RE: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-05 Thread shiy.f...@fujitsu.com
On Mon, Dec 5, 2022 6:57 PM Amit Kapila wrote: > > On Mon, Dec 5, 2022 at 3:41 PM Dilip Kumar wrote: > > > > I think we need something like this[1] so that we can better control > > the streaming. > > > > +1. The additional advantage would be that we can generate parallel > apply and new stream

RE: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-06 Thread shiy.f...@fujitsu.com
On Wed, Dec 7, 2022 12:01 PM Dilip Kumar wrote: > > On Wed, Dec 7, 2022 at 9:28 AM Amit Kapila > wrote: > > > > On Tue, Dec 6, 2022 at 11:55 AM shiy.f...@fujitsu.com > > wrote: > > > > > > On Mon, Dec 5, 2022 6:57 PM Amit Kapila > wrote: >

RE: Truncate in synchronous logical replication failed

2021-04-22 Thread shiy.f...@fujitsu.com
> I don't think here we need to restart to get a stable list of indexes > as we do in RelationGetIndexAttrBitmap. The reason is here we build > the cache entry using a historic snapshot and all the later changes > are absorbed while decoding WAL. I have updated that and modified few > comments in t

RE: Logical replication timeout problem

2023-01-29 Thread shiy.f...@fujitsu.com
On Sun, Jan 29, 2023 3:41 PM wangw.f...@fujitsu.com wrote: > > I tested a mix transaction of transactional and non-transactional messages on > the current HEAD and reproduced the timeout problem. I think this result is > OK. > Because when decoding a transaction, non-transactional changes are p

RE: Time delayed LR (WAS Re: logical replication restrictions)

2023-02-01 Thread shiy.f...@fujitsu.com
On Mon, Jan 30, 2023 6:05 PM Takamichi Osumi (Fujitsu) wrote: > > On Saturday, January 28, 2023 1:28 PM I wrote: > > Attached the updated patch v24. > Hi, > > > I've conducted the rebase affected by the commit(1e8b61735c) > by renaming the GUC to logical_replication_mode accordingly, > because

RE: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-02-06 Thread shiy.f...@fujitsu.com
On Thu, Feb 2, 2023 11:48 AM shveta malik wrote: > > On Wed, Feb 1, 2023 at 5:42 PM Melih Mutlu > wrote: > > > > Hi Shveta, > > > > shveta malik , 1 Şub 2023 Çar, 15:01 tarihinde > şunu yazdı: > >> > >> On Wed, Feb 1, 2023 at 5:05 PM Melih Mutlu > wrote: > >> 2) I found a crash in the previous

RE: run pgindent on a regular basis / scripted manner

2023-02-09 Thread shiy.f...@fujitsu.com
On Thu, Feb 9, 2023 6:10 AM Andrew Dunstan wrote: > Thanks, I have committed this. Still looking at Robert's other request. > Hi, I tried the new option --commit and found that it seems to try to indent files which are deleted in the specified commit and reports an error. cannot open file "src

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-13 Thread shiy.f...@fujitsu.com
On Thu, Feb 2, 2023 4:34 PM Önder Kalacı wrote: > >> >> and if there's more >> than one candidate index pick any one. Additionally, we can allow >> disabling the use of an index scan for this particular case. If we are >> too worried about API change for allowing users to specify the index >> then

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-14 Thread shiy.f...@fujitsu.com
On Mon, Feb 13, 2023 7:01 PM shiy.f...@fujitsu.com wrote: > > On Thu, Feb 2, 2023 4:34 PM Önder Kalacı wrote: > > > >> > >> and if there's more > >> than one candidate index pick any one. Additionally, we can allow > >> disabling the use

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-14 Thread shiy.f...@fujitsu.com
On Sat, Feb 4, 2023 7:24 PM Amit Kapila wrote: > > On Thu, Feb 2, 2023 at 2:03 PM Önder Kalacı wrote: > > > >> > >> and if there's more > >> than one candidate index pick any one. Additionally, we can allow > >> disabling the use of an index scan for this particular case. If we are > >> too worr

RE: Add LZ4 compression in pg_dump

2023-02-15 Thread shiy.f...@fujitsu.com
On Fri, Jan 27, 2023 2:04 AM gkokola...@pm.me wrote: > > --- Original Message --- > On Thursday, January 26th, 2023 at 12:53 PM, Michael Paquier > wrote: > > > > > > > > On Thu, Jan 26, 2023 at 11:24:47AM +, gkokola...@pm.me wrote: > > > > > I gave this a little bit of thought. I t

RE: run pgindent on a regular basis / scripted manner

2023-02-16 Thread shiy.f...@fujitsu.com
On Thu, Feb 9, 2023 6:10 AM Andrew Dunstan wrote: > Thanks, I have committed this. Still looking at Robert's other request. > Hi, Commit #068a243b7 supported directories to be non-option arguments of pgindent. But the help text doesn't mention that. Should we update it? Attach a small patch whic

Missing default value of createrole_self_grant in document

2023-02-16 Thread shiy.f...@fujitsu.com
Hi hackers, I noticed that the document of GUC createrole_self_grant doesn't mention its default value. The attached patch adds that. Regards, Shi Yu v1-0001-Add-default-value-of-createrole_self_grant-in-doc.patch Description: v1-0001-Add-default-value-of-createrole_self_grant-in-doc.patch

"out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-18 Thread shiy.f...@fujitsu.com
Hi hackers, After multiple calls to the function pg_logical_slot_get_binary_changes() in single client backend (the output plugin of the slot is pgoutput), I got the following error: client backend FATAL: out of relcache_callback_list slots client backend CONTEXT: slot "testslot", output plugin

RE: Allow logical replication to copy tables in binary format

2023-02-20 Thread shiy.f...@fujitsu.com
On Thu, Feb 16, 2023 8:48 PM Amit Kapila wrote: > > On Mon, Jan 30, 2023 at 4:19 PM Melih Mutlu > wrote: > > > > Logical replication between different types like int and smallint is > > already not > working properly on HEAD too. > > Yes, the scenario you shared looks like working. But you didn

RE: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-21 Thread shiy.f...@fujitsu.com
On Mon, Feb 20, 2023 11:31 PM Tom Lane wrote: > > Kyotaro Horiguchi writes: > > I'm pretty sure that everytime an output plugin is initialized on a > > process, it installs the same set of syscache/relcache callbacks each > > time. Do you think we could simply stop duplicate registration of > >

Fix some newly modified tab-complete changes

2022-09-27 Thread shiy.f...@fujitsu.com
Hi hackers, I saw a problem when using tab-complete for "GRANT", "TABLES IN SCHEMA" should be "ALL TABLES IN SCHEMA" in the following case. postgres=# grant all on ALL FUNCTIONS IN SCHEMA DATABASE FUNCTION PARAMETER SCHEMATA

RE: Fix some newly modified tab-complete changes

2022-09-28 Thread shiy.f...@fujitsu.com
On Wed, Sep 28, 2022 1:49 PM Kyotaro Horiguchi wrote: > > At Wed, 28 Sep 2022 14:14:01 +1000, Peter Smith > wrote in > > On Tue, Sep 27, 2022 at 8:28 PM shiy.f...@fujitsu.com > > wrote: > > > > > > Hi hackers, > > > > > > I saw a problem

RE: Fix some newly modified tab-complete changes

2022-10-09 Thread shiy.f...@fujitsu.com
On Tue, Oct 4, 2022 4:17 PM Peter Smith wrote: > > On Thu, Sep 29, 2022 at 12:50 PM shiy.f...@fujitsu.com > wrote: > > > > On Wed, Sep 28, 2022 1:49 PM Kyotaro Horiguchi > wrote: > > > > > > At Wed, 28 Sep 2022 14:14:01 +1000, Peter Smith > > &

RE: Fix some newly modified tab-complete changes

2022-10-10 Thread shiy.f...@fujitsu.com
On Mon, Oct 10, 2022 2:12 PM shiy.f...@fujitsu.com wrote: > > On Tue, Oct 4, 2022 4:17 PM Peter Smith wrote: > > > > But, while testing I noticed another different quirk > > > > It seems that neither the GRANT nor the REVOKE auto-complete > > recog

RE: [RFC] building postgres with meson - v13

2022-10-13 Thread shiy.f...@fujitsu.com
Hi, I noticed that `pg_config --configure` didn't show the options given when building with meson. For example, meson setup build -Dcache=gcc.cache -Ddtrace=enabled -Dicu=enabled -Dcassert=true -Dprefix=/home/postgres/install_meson/ meson compile -C build meson install -C build $ pg_config -

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-10-13 Thread shiy.f...@fujitsu.com
On Wed, Aug 24, 2022 12:25 AM Önder Kalacı wrote: > Hi, > > Thanks for the review! > Thanks for your reply. > > > > > 1. > > In FilterOutNotSuitablePathsForReplIdentFull(), is > > "nonPartialIndexPathList" a > > good name for the list? Indexes on only expressions are also be filtered. > > > >

RE: [RFC] building postgres with meson - v13

2022-10-13 Thread shiy.f...@fujitsu.com
On Fri, Oct 14, 2022 12:40 AM Andres Freund wrote: > > Hi, > > On 2022-10-13 09:24:51 +, shiy.f...@fujitsu.com wrote: > > I noticed that `pg_config --configure` didn't show the options given when > > building with meson. > > Yes, that was noted somewhere

RE: create subscription - improved warning message

2022-10-17 Thread shiy.f...@fujitsu.com
On Mon, Oct 17, 2022 9:47 AM Peter Smith wrote: > > On Sun, Oct 16, 2022 at 12:14 AM Amit Kapila > wrote: > > > > On Fri, Oct 14, 2022 at 8:22 AM Peter Smith > wrote: > > > > > > On Thu, Oct 13, 2022 at 9:07 AM Peter Smith > wrote: > > > > > ... > > > PSA a patch for adding examples of how to

RE: create subscription - improved warning message

2022-10-18 Thread shiy.f...@fujitsu.com
On Tue, Oct 18, 2022 5:44 PM Peter Smith wrote: > > On Mon, Oct 17, 2022 at 7:11 PM shiy.f...@fujitsu.com > wrote: > > > ... > > > > Thanks for your patch. Here are some comments. > > > > In Example 2, the returned slot_name should be &

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-10-19 Thread shiy.f...@fujitsu.com
On Wed, Oct 19, 2022 12:05 AM Önder Kalacı wrote: > > Attached v19. > Thanks for updating the patch. Here are some comments on v19. 1. In execReplication.c: + TypeCacheEntry **eq = NULL; /* only used when the index is not unique */ Maybe the comment here should be changed. Now it is u

RE: Perform streaming logical transactions by background workers and parallel apply

2022-10-26 Thread shiy.f...@fujitsu.com
On Wed, Oct 26, 2022 7:19 PM Amit Kapila wrote: > > On Tue, Oct 25, 2022 at 8:38 AM Masahiko Sawada > wrote: > > > > On Fri, Oct 21, 2022 at 6:32 PM houzj.f...@fujitsu.com > > wrote: > > > > I've started to review this patch. I tested v40-0001 patch and have > > one question: > > > > IIUC even

RE: Perform streaming logical transactions by background workers and parallel apply

2022-10-28 Thread shiy.f...@fujitsu.com
On Tue, Oct 25, 2022 2:56 PM Wang, Wei/王 威 wrote: > > On Tues, Oct 25, 2022 at 14:28 PM Peter Smith > wrote: > > FYI - After a recent push, the v40-0001 patch no longer applies on the > > latest HEAD. > > > > [postgres@CentOS7-x64 oss_postgres_misc]$ git apply > > ../patches_misc/v40-0001-Perfor

RE: Segfault on logical replication to partitioned table with foreign children

2022-10-30 Thread shiy.f...@fujitsu.com
On Sun, Oct 30, 2022 9:39 PM Tom Lane wrote: > > What I'm wondering about is whether we can refactor this code > to avoid so many usually-useless catalog lookups. Pulling the > namespace name, in particular, is expensive and we generally > are not going to need the result. In the child-rel case

RE: bogus: logical replication rows/cols combinations

2022-05-16 Thread shiy.f...@fujitsu.com
On Mon, May 16, 2022 8:34 PM houzj.f...@fujitsu.com wrote: > > Attach the new version patch. > Thanks for your patch. Here are some comments: 1. (0001 patch) /* * Returns Oids of tables in a publication. */ Datum pg_get_publication_tables(PG_FUNCTION_ARGS) Should we modify the comment of p

RE: Skipping schema changes in publication

2022-05-17 Thread shiy.f...@fujitsu.com
On Sat, May 14, 2022 9:33 PM vignesh C wrote: > > Thanks for the comments, the attached v5 patch has the changes for the > same. Also I have made the changes for SKIP Table based on the new > syntax, the changes for the same are available in > v5-0002-Skip-publishing-the-tables-specified-in-EXCEP

RE: Handle infinite recursion in logical replication setup

2022-05-18 Thread shiy.f...@fujitsu.com
On Wed, May 4, 2022 2:47 PM vignesh C wrote: > > Thanks for the comments, the attached v13 patch has the changes for the same. > Thanks for your patch. Here are some comments on v13-0001 patch. 1) @@ -152,6 +152,18 @@ CREATE SUBSCRIPTION subscription_name + +local_on

RE: Handle infinite recursion in logical replication setup

2022-05-19 Thread shiy.f...@fujitsu.com
On Wed, May 4, 2022 2:47 PM vignesh C wrote: > > Thanks for the comments, the attached v13 patch has the changes for the same. > Here are some comments on v13-0002 patch. 1) +* Throw an error so that the user can take care of the initial data +* copying and then

RE: Handle infinite recursion in logical replication setup

2022-05-23 Thread shiy.f...@fujitsu.com
On Tue, May 24, 2022 1:34 AM vignesh C wrote: > > Thanks for the comments, the attached v15 patch has the fixes for the same. > Thanks for updating the patch. I have a comment on the document in 0002 patch. @@ -300,6 +310,11 @@ CREATE SUBSCRIPTION subscription_namefalse. +

RE: Handle infinite recursion in logical replication setup

2022-05-27 Thread shiy.f...@fujitsu.com
On Wed, May 25, 2022 7:55 PM vignesh C wrote: > > The attached v16 patch has the changes for the same. > Thanks for updating the patch. Some comments for the document in 0002 patch. 1. + +Lock the required tables in node1 and +node2 till the setup is completed. + + + +Cre

RE: Hash index build performance tweak from sorting

2022-05-30 Thread shiy.f...@fujitsu.com
On Tue, May 10, 2022 5:43 PM Simon Riggs wrote: > > On Sat, 30 Apr 2022 at 12:12, Amit Kapila > wrote: > > > > Few comments on the patch: > > 1. I think it is better to use DatumGetUInt32 to fetch the hash key as > > the nearby code is using. > > 2. You may want to change the below comment in HS

RE: Handle infinite recursion in logical replication setup

2022-06-06 Thread shiy.f...@fujitsu.com
On Mon, Jun 6, 2022 1:14 PM vignesh C wrote: > > The attached v18 patch has the fixes for the same. > Thanks for updating the patch, here are some comments. 0002 patch == 1. + +origin (string) + + It maybe better if the type of "origin" parameter

Replica Identity check of partition table on subscriber

2022-06-08 Thread shiy.f...@fujitsu.com
Hi hackers, I saw a problem in logical replication, when the target table on subscriber is a partitioned table, it only checks whether the Replica Identity of partitioned table is consistent with the publisher, and doesn't check Replica Identity of the partition. For example: -- publisher -- crea

RE: Replica Identity check of partition table on subscriber

2022-06-10 Thread shiy.f...@fujitsu.com
On Thu, June 9, 2022 7:02 PM Amit Kapila wrote: > > > I think one approach to fix it is to check the target partition in this > > case, > > instead of the partitioned table. > > > > This approach sounds reasonable to me. One minor point: > +/* > + * Check that replica identity matches. > + * >

RE: tablesync copy ignores publication actions

2022-06-13 Thread shiy.f...@fujitsu.com
On Wed, Jun 8, 2022 12:10 PM Amit Kapila wrote: > > On Tue, Jun 7, 2022 at 7:08 PM Euler Taveira wrote: > > > > On Tue, Jun 7, 2022, at 1:10 AM, Peter Smith wrote: > > > > The logical replication tablesync ignores the publication 'publish' > > operations during the initial data copy. > > > > Thi

RE: Replica Identity check of partition table on subscriber

2022-06-14 Thread shiy.f...@fujitsu.com
On Tue, Jun 14, 2022 2:18 PM Amit Langote wrote: > > On Mon, Jun 13, 2022 at 9:26 PM Amit Kapila > wrote: > > On Mon, Jun 13, 2022 at 1:03 PM houzj.f...@fujitsu.com > > wrote: > > > On Monday, June 13, 2022 1:53 PM Amit Kapila > wrote: > > > I have separated out the bug-fix for the subscriber-

RE: Replica Identity check of partition table on subscriber

2022-06-14 Thread shiy.f...@fujitsu.com
On Tue, Jun 14, 2022 8:57 PM Amit Kapila wrote: > > > v4-0002 looks good btw, except the bitpick about test comment similar > > to my earlier comment regarding v5-0001: > > > > +# Change the column order of table on publisher > > > > I think it might be better to say something specific to describ

  1   2   >