Skip to content

Commit

Permalink
Revert "[#12293] YSQL: Use better defaults for copy command"
Browse files Browse the repository at this point in the history
Summary:
The previous commits broke the xcluster replication (specifically when setting `ysql_session_max_batch_size` at too high value). The issue was not included in a unit test or integration test. Reverting to the old value fixes the problem.

This reverts commit d95a159.

Revert "[#12293] YSQL: Adjust default value in copy test"

This reverts commit 3cb638e.

Test Plan:
jenkins

Test with xcluster replication to ensure it resumes working as normal.

Reviewers: jhe, slingam, rthallam

Reviewed By: slingam, rthallam

Subscribers: smishra, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D16914
  • Loading branch information
lnguyen-yugabyte authored and lnguyen committed May 11, 2022
1 parent 4b25288 commit 9c72d68
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class TestBatchCopyFrom extends BasePgSQLTest {
"violates foreign key constraint";
private static final String BATCH_TXN_SESSION_VARIABLE_NAME =
"yb_default_copy_from_rows_per_transaction";
private static final int BATCH_TXN_SESSION_VARIABLE_DEFAULT_ROWS = 20000;
private static final int BATCH_TXN_SESSION_VARIABLE_DEFAULT_ROWS = 1000;
private static final String DISABLE_TXN_WRITES_SESSION_VARIABLE_NAME =
"yb_disable_transactional_writes";
private static final String YB_ENABLE_UPSERT_MODE_VARIABLE_NAME =
Expand Down
2 changes: 1 addition & 1 deletion src/postgres/src/include/commands/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "parser/parse_node.h"
#include "tcop/dest.h"

#define DEFAULT_BATCH_ROWS_PER_TRANSACTION 20000
#define DEFAULT_BATCH_ROWS_PER_TRANSACTION 1000

/* CopyStateData is private in commands/copy.c */
typedef struct CopyStateData *CopyState;
Expand Down
2 changes: 1 addition & 1 deletion src/yb/yql/pggate/pggate_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ DEFINE_uint64(ysql_prefetch_limit, 1024,
DEFINE_double(ysql_backward_prefetch_scale_factor, 0.0625 /* 1/16th */,
"Scale factor to reduce ysql_prefetch_limit for backward scan");

DEFINE_uint64(ysql_session_max_batch_size, 3072,
DEFINE_uint64(ysql_session_max_batch_size, 512,
"Use session variable ysql_session_max_batch_size instead. "
"Maximum batch size for buffered writes between PostgreSQL server and YugaByte DocDB "
"services");
Expand Down

0 comments on commit 9c72d68

Please sign in to comment.