Skip to content

Commit

Permalink
Merge pull request #6460 from EnterpriseDB/xdb/mtk/keepalive
Browse files Browse the repository at this point in the history
[XDB/MTK] Read timeout error and workaround
  • Loading branch information
gvasquezvargas authored Feb 6, 2025
2 parents a8db623 + decc2fe commit 513c409
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ redirects:
- /eprs/7/10_appendix/03_resolving_problems/01_error_messages
---

<div id="error_messages" class="registered_link"></div>

These error messages can appear from the Replication Server console. The messages are listed in alphabetical order.

This list includes only the messages that typically involve initial configuration operations requiring additional information for resolving the problem.
Expand Down Expand Up @@ -574,7 +572,9 @@ Occurs when attempting an operation such as performing synchronization replicati

`DB-42501: com.edb.util.PSQLException: ERROR: permission denied for relation pg_class.`

**Resolution** Occurs when attempting to create an MMR publication database definition and the publication server can't create the control schema objects in the new publication database. This typically results when creating a second publication database definition and the publication server can't copy by snapshot the control schema objects from the controller database to the new publication database. The publication database user of the new publication database must be a superuser. In addition, in system catalog table `pg_catalog.pg_authid`, column `rolcatupdate` must be set to true for this superuser. See [Disabling foreign key constraints for snapshot replications](../03_miscellaneous_xdb_processing_topics/04_disable_foreign_key_constraints_for_snapshot_replication/#disable_foreign_key_constraints_for_snapshot_replication).
**Resolution**

Occurs when attempting to create an MMR publication database definition and the publication server can't create the control schema objects in the new publication database. This typically results when creating a second publication database definition and the publication server can't copy by snapshot the control schema objects from the controller database to the new publication database. The publication database user of the new publication database must be a superuser. In addition, in system catalog table `pg_catalog.pg_authid`, column `rolcatupdate` must be set to true for this superuser. See [Disabling foreign key constraints for snapshot replications](../03_miscellaneous_xdb_processing_topics/04_disable_foreign_key_constraints_for_snapshot_replication/#disable_foreign_key_constraints_for_snapshot_replication).

**Problem**

Expand Down Expand Up @@ -658,3 +658,33 @@ The control schema objects in the publication database might have been deleted o
**Resolution**

An Oracle publication database user must have `CONNECT`, `RESOURCE`, and `CREATE ANY TRIGGER` privileges.

**Problem**

`DB-08006: com.edb.util.PSQLException: An I/O error occurred while sending to the backend.`

`java.net.SocketTimeoutException: Read timed out`

**Resolution**

Occurs when performing a snapshot operation on an EDB Postgres Advanced Server or PostgreSQL subscription database server. The published tables' size ranges in the hundreds of gigabytes or the network between the database server and Replication Server is slow, which causes the snapshot operation to take multiple hours.

The error message is reported after a successful data copy at the stage of enabling constraints.

This happens because the server is configured by default to close idle TCP connection opened by Replication Server to create constraints.

To work around this issue, modify the following parameters in the `postgresql.conf` file of the subscription database server:

```
tcp_keepalives_idle = 60 # TCP_KEEPIDLE, in seconds;
tcp_keepalives_interval = 10 # TCP_KEEPINTVL, in seconds;
tcp_keepalives_count = 10 # TCP_KEEPCNT;
```

Reload the configuration to make the changes effective:

```
select pg_reload_conf();
```

This way, tcp_keepalive messages won't let the connection become idle and Replication Server won't report a broken connection.
33 changes: 31 additions & 2 deletions product_docs/docs/migration_toolkit/55/09_mtk_errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: "Migration errors"
deepToC: true
---

<div id="mtk_errors" class="registered_link"></div>

During the migration process, the migration summary displays the progress of the migration. If an error occurs, the summary displays information about the error. The migration summary is also written to a log file.

On Linux, the default location for the log files is:
Expand Down Expand Up @@ -274,6 +272,37 @@ By default, the MySQL JDBC driver fetches all of the rows in a table into Migrat

To correct the problem, specify `-fetchSize 1` as a command-line argument when you retry the migration.

### Error: Read timeout during data migration

*When I perform a migration to a target EDB Postgres Advanced Server or PostgreSQL server, Migration Toolkit reports a timeout error:*

```
DB-08006: com.edb.util.PSQLException: An I/O error occurred while sending to the backend.
java.net.SocketTimeoutException: Read timed out
```

The target database server is either EDB Postgres Advanced Server or PostgreSQL and you are performing a data migration. The source tables' size ranges in the hundreds of gigabytes or the network between the database server and Migration Toolkit is slow, which causes the migration to take multiple hours.

The error message is reported after a successful data copy at the stage of enabling constraints.

This occurs because the server's default configuration closes idle TCP connections opened by Migration Toolkit to create constraints.

To work around this issue, modify the following parameters in the `postgresql.conf` file of the target database server:

```
tcp_keepalives_idle = 60 # TCP_KEEPIDLE, in seconds;
tcp_keepalives_interval = 10 # TCP_KEEPINTVL, in seconds;
tcp_keepalives_count = 10 # TCP_KEEPCNT;
```

Then, reload the configuration to make the changes effective:

```
select pg_reload_conf();
```

This way, tcp_keepalive messages won't let the connection become idle and Migration Toolkit won't report a broken connection.

### Incorrect timestamps and Daylight Saving Time

When migrating from SQL Server to PostgreSQL using the MSSQL JDBC driver, an error in the migration of timestamps may occur that is not reported. Specifically, if the source database contains rows with timestamp values that are within a range of time when Daylight Savings Time was in effect, those rows will be migrated to the target database with the wrong timestamps.
Expand Down

1 comment on commit 513c409

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.