On Feb, Wed 23, 2022 at 10:58 PM Ajin Cherian <itsa...@gmail.com> wrote: > Few comments to V19-0001:
1. I think we should adjust the alignment format. git am ../v19-0001-Skip-empty-transactions-for-logical-replication.patch .git/rebase-apply/patch:197: indent with spaces. * Before we send schema, make sure that STREAM START/BEGIN/BEGIN PREPARE .git/rebase-apply/patch:198: indent with spaces. * is sent. If not, send now. .git/rebase-apply/patch:199: indent with spaces. */ .git/rebase-apply/patch:201: indent with spaces. pgoutput_send_stream_start(ctx, toptxn); .git/rebase-apply/patch:204: indent with spaces. pgoutput_begin(ctx, toptxn); warning: 5 lines add whitespace errors. 2. Structure member initialization. static void pgoutput_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { + PGOutputTxnData *txndata = MemoryContextAllocZero(ctx->context, + sizeof(PGOutputTxnData)); + + txndata->sent_begin_txn = false; + txn->output_plugin_private = txndata; +} Do we need to set sent_stream_start and sent_any_stream to false here? 3. Maybe we should add Assert(txndata) like function pgoutput_commit_txn in other functions. 4. In addition, I think we should keep a unified style. a). log style (maybe first one is better.) First style : "Skipping replication of an empty transaction in XXX" Second style : "skipping replication of an empty transaction" b) flag name (maybe second one is better.) First style : variable "sent_begin_txn" in function pgoutput_stream_*. Second style : variable "skip" in function pgoutput_commit_txn. Regards, Wang wei