SAP/HANADB

Replication Modes for SAP HANA System Replication(HA 모드)

미미면 2023. 7. 3. 14:10
728x90
반응형

이중화 모드에 대해 ~ 정리를 해보자아~~~
 
While registering the secondary system, you need to decide which replication mode to use.
SAP HANA offers different modes for the replication of the redo log:

Replication modesLog Replication ModeDescription
Synchronous in-memory (SYNCMEM) The primary system commits the transaction after it gets a reply that the log was received by the secondary system and stored in memory. The delay for the transaction in the primary system is smaller, because it only includes the time for transmitting the data. The disk I/O speed on the secondary system doesn't influence the primary's performance.
When the connection to the secondary system is lost, the primary system continues the transaction processing and writes the changes only to the local disk.
Data loss can occur in the following situations:
  • When the primary and the secondary system fail at the same time while the secondary system is connected. The data is not written to disk – neither on the primary nor on the secondary system.
  • When a takeover is executed while the secondary system is unavailable. The data that arrived on the secondary is outdated compared to the data on the primary.
This option provides better performance because it is not necessary to wait for disk I/O on the secondary system, but it is more vulnerable to data loss.

Primary system 은 트랜젝션 로그가 Secondary system 의 메모리까지 쓰여졌다는 응답을 받은 후에 commit
Synchronous on disk (SYNC) The primary system waits with committing the transaction until it gets a reply that the log is persisted in the secondary system. This option guarantees immediate consistency between both systems, at a cost of delaying the transaction by the time for data transmission and persisting in the secondary system.
When the connection to the secondary system is lost, the primary system continues the transaction processing and writes the changes only to the local disk. No data loss occurs in this scenario as long as the secondary system is connected. Data loss can occur, when a takeover is executed while the secondary system is disconnected.
Additionally, this replication mode can run with a full sync option. This means that log write is successful when the log buffer has been written to the log file of the primary and the secondary system. When the secondary system is disconnected (for example, because of network failure), the primary system suspends the transaction processing until the connection to the secondary system is reestablished. No data loss occurs in this scenario. You can set the full sync option for system replication with the parameter [system_replication]/enable_full_sync.
Note
If SAP HANA system replication runs in the SYNC replication mode with the full sync option enabled, and if the connection to the secondary site is interrupted, no write operations on the primary site are possible. The operation of creating a tenant database, for example, will wait until the connection to the secondary is reestablished or the SQL statement times out.
For more information about how to enable the full sync option, see Full Sync Option for System Replication.

Primary system 은 트랜젝션 로그가 Secondary system 의 디스크까지 쓰여졌다는 응답을 받은 후에 commit
Asynchronous (ASYNC) The primary system commits the transaction after sending the log without waiting for a response. Here we have no delay because the data transmission is asynchronous to the transaction in the primary system.This option provides better performance because it is not necessary to wait for log I/O on the secondary system. Database consistency across all services on the secondary system is guaranteed. However, it is more vulnerable to data loss. Data changes may be lost during takeover.

Primary system은 트랜잭션 로그가 Secondary system 으로 보내지만 응답을 기다리지 않음.
 
 

Changing the Replication Mode

The replication mode can be changed without going through a full data shipping from the primary system to the secondary system afterwards.

To change the replication mode, use the following command on the online or offline secondary system:

hdbnsutil -sr_changemode --mode=sync|syncmem|async
 
 
In the M_SERVICE_REPLICATION view you can check whether the replication mode was changed correctly. The following command provides this information too:

hdbnsutil -sr_state --sapcontrol=1
반응형