Database Session Drain Rules Engine for Planned Failover

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database management systems face challenges in gracefully terminating database sessions during planned maintenance, especially when applications use non-compliant connection pool managers, leading to disruptions and errors due to incomplete or long-running requests, and the inability to safely disconnect sessions without impacting applications.

Innovation Solution

The implementation of a rules engine within the database management system that proactively identifies safe points for session termination by monitoring session activity and applying rules based on historical statistics and configuration data to determine when a session can be safely drained or disconnected, minimizing application errors during planned operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the database management system waits for request completion before disconnecting sessions, then application continuity is maintained, but maintenance window is exceeded and system availability is reduced

Engineering Contradiction:
Improveapplication continuityVSAvoidmaintenance window
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by identifying safe termination points and proactively draining sessions before the maintenance operation begins. The DBMS monitors session activity and identifies points where requests can be safely terminated, allowing connections to be disconnected in advance rather than waiting for natural completion.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The session termination process is segmented into multiple phases: identification of safe termination points, gradual draining of sessions, and final disconnection. This segmentation allows the system to terminate sessions at optimal points rather than forcing immediate termination or waiting for all sessions to complete naturally.

Inventive Principle:
Principle #1Segmentation

2Loss of time

If the database management system forcibly terminates long-running requests, then maintenance window is met, but application errors and disruptions occur

Engineering Contradiction:
Improvemaintenance windowVSAvoidapplication error rate
Core Design Contradiction:
Loss of timeVSReliability

Solution Approach 1:

The system identifies safe termination points in advance before forcing any session termination. By monitoring session activity and identifying points where requests can be safely interrupted, the system minimizes application errors when maintenance operations require connection disconnection.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The DBMS continuously monitors session activity and provides feedback on the state of each session. This feedback mechanism allows the system to identify when a session has reached a safe termination point, enabling intelligent decision-making about when to disconnect connections without causing application errors.

Inventive Principle:
Principle #23Feedback

3Productivity

If connection pools are used to reuse sessions, then connection overhead is reduced, but session termination becomes complex and maintenance operations are hindered

Engineering Contradiction:
Improveconnection efficiencyVSAvoidsession management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system introduces an intermediary mechanism that sits between the connection pool and the database sessions. This intermediary monitors session activity, identifies safe termination points, and coordinates with the connection pool manager to drain sessions appropriately, simplifying the overall termination process while maintaining connection pool efficiency.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Adaptability or versatility

If non-compliant connection pool managers are used, then application compatibility is improved, but safe session draining cannot be performed and disruptions occur

Engineering Contradiction:
Improveapplication compatibilityVSAvoidsession termination success
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The DBMS implements a feedback mechanism that monitors session activity and provides information to non-compliant connection pool managers. This feedback allows the system to identify safe termination points and coordinate session draining even when the connection pool manager does not fully support the draining protocol, improving termination success while maintaining compatibility.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system acts as an intermediary between non-compliant connection pool managers and the session termination process. By monitoring session activity and identifying safe termination points, the DBMS can guide the termination process even when the connection pool manager lacks full compliance, ensuring successful session drainage without requiring application changes.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11687507B2Termination of database sessions for planned failover
Publication Date: 2023.06.27 ORACLE INT CORP
  • US11687507B2 patent drawing
  • US11687507B2 patent drawing
  • US11687507B2 patent drawing

AI summary

Techniques are described for performing session termination(s) for active sessions in response to a planned operation on a database server of a DBMS. In an embodiment, the DBMS receives a request for a planned operation on a database server. The database server may have session(s) established with a client system to receive request(s) to execute database command(s) on the DBMS. In response, the DBMS transmits to the client system a notification to drain a session with the database server, and the DBMS marks the sessions at the database to drain. The DBMS is configured to terminate any drain-marked sessions by the database server when a rule is satisfied, and the failover is expected to succeed, and/or that the session is unlikely to drain or to failover at a later point in the session lifecycle. The DBMS may identify, in a rule set, a rule having rule instructions to detect a possible termination point for the session before the drain timeout period expires. Based on the execution of the rule instructions before the drain timeout expires, the DBMS determines that a termination point for the session is detected where that session will failover. In such a way, sessions are failed over early and at points where the failover is expected to succeed.