1.4. SAP HANA HA/DR provider hooks


Current versions of SAP HANA provide an API in the form of hooks that allow the HANA instance to send notifications for certain events, for example the loss or establishment of the system replication. For each event, the HANA instance calls the configured hooks, also called HA/DR providers. Hooks are custom Python scripts which process the events that HANA sends and the scripts can trigger different actions based on the event information.

You must add the HA/DR provider definition to the HANA global configuration to enable the required functionality of triggering additional actions for certain events.

HanaSR for the srConnectionChanged() hook method

The HanaSR hook is required for processing the srConnectionChanged() hook method. This method is used by the primary HANA instance for a notification of any change in the HANA system replication status. The primary HANA instance calls the HanaSR HA/DR provider when a HANA system replication related event occurs. The hook script HanaSR.py then parses srConnectionChanged() events for the system replication status detail and as a result it updates the srHook cluster attribute. This attribute is used by the resource agents to evaluate the landscape health and make decisions. The value of the system replication or sync state defines if the cluster recovers a failed primary instance on the same node or if it triggers a takeover to the secondary. The takeover is only triggered when the system replication is fully in sync, which means the HANA data is consistent between the HANA sites.

重要

You must configure the HanaSR hook to enable the srConnectionChanged() hook method for proper function and full support of the HA cluster setup.

ChkSrv for the srServiceStateChanged() hook method

When the HANA instance detects an issue with a HANA indexserver process it recovers from the problem by stopping and restarting the hdbindexserver service automatically through an internal mechanism.

However, especially for very large HANA instances, the hdbindexserver service can take a very long time for the stopping phase of this recovery process. Although HANA reports this service degradation not as an error in the HANA landscape, the situation poses a risk to the data consistency if anything else fails in the instance during that time. To improve the unpredictable service recovery time, you can configure the ChkSrv hook to stop or kill the entire affected HANA instance instead.

In a setup with automatic failover enabled (PREFER_SITE_TAKEOVER=true), the instance stop leads to a takeover if the secondary node is in a healthy state. Otherwise, instance recovery happens locally, but the enforced local instance restart accelerates the process.

The HANA instance calls the ChkSrv hook when an event occurs. The hook script ChkSrv.py processes the srServiceStateChanged() hook method and executes actions based on the results of the filters it applies to event details. This way the ChkSrv.py hook script can distinguish a HANA hdbindexserver process that is being stopped and restarted by HANA after a failure from the same process being stopped as part of an intended instance shutdown. When the hook script determines that the event is caused by a failure it triggers the configured action.

The ChkSrv.py hook script has multiple options to define what happens when an indexserver failure event is detected:

  • ignore

    This action just writes the parsed events and decision information to a dedicated logfile. This is useful for testing and verifying what the hook script would do when activating stop or kill actions.

  • stop

    This action executes a graceful StopSystem for the instance through the sapcontrol command.

  • kill

    This action executes the HDB kill-<signal> command with a default signal 9, which can be configured. The result is the same as when using stop, but can be faster.

注意

Any indexserver failure is treated individually by HANA. The same processes are always triggered for every single indexserver issue.

Enabling the srServiceStateChanged() hook is optional.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部