Push data session survival

By default, if client gets disconnected from server, server deletes push-data event conditions for the session, and server no longer capture the event data. The following APIs allow server to capture the event data for the push-data client if client is temporarily disconnected from the server.

Detachable sessions can survive from server failure. Client can re-attach to detachable sessions after bouncing the server or after primary server failover operation in a cluster environment with secondary servers. After bouncing server, it is possible for the pushdata client to get duplicate records. Client need to save last received record txnid and op_num and discard the processed records. restart_logid and restart_logpos are added to INSER, UPDATE and DELETE records returned to the push data sessions. After server failover or upon restarting Informix server, client can re-attach to the detached session and reset Enterprise replication capture position back to estart_logid and restart_logpos using ‘pushdata reset_capture’ sysadmin task/admin API.
  • To mark a session as a detachable session:
    execute function informix.task('pushdata setdetach') into :retvalstr;
    This API returns unique session id.
  • To re-join a detached session after reconnecting to server:
    execute function informix.task('pushdata join', "{session_id:"245"}) into :retvalstr;
    Returns smartblob file descriptor to read event data. Unique session id returned from 'pushdata setdetach' API is used as input to 'pushdata join' API. 'pushdata join' returns smartblob file descriptor -- same as 'pushdata open'.
    Note: 'pushdata open' and 'pushdata join' APIs should not be called in the same session.
    'pushdata open' is used to establish new push-data session, and 'pushdata join' API is used to join existing detached push-data session.
  • To delete "detachable" push-data session information from the server:
    • To delete currently attached push-data session:
      execute function informix.task('pushdata delete') into :retvalstr;
      This is only required if the push-data session is marked as a detachable session using API 'pushdata setdetach'.
    • To delete a specific unique session id currently not attached to any client application:
      execute function task('pushdata delete', '{session_id:"12"}') ;
    • To delete all push-data sessions that are not attached to any client applications:
      execute function task('pushdata delete', '{delete_all:"1"}');