Solving the Distributed Database Global Deadlock Challenge: GBase 8c Drives a Database Revolution

Published on 2022-05-18

With the explosion of data, distributed databases are gaining enterprise adoption for their high availability, scalability, and cost-efficiency. The distributed database era has arrived!

GBase 8c is a multi-model, multi-form distributed database. It supports row-store, column-store, in-memory storage modes, and deployment options including standalone, primary-standby, and distributed. With high performance, high availability, elastic scalability, and strong security, it can be deployed on physical servers, virtual machines, containers, private clouds, and public clouds—providing secure, stable, and reliable data storage and management for core systems in critical industries, internet businesses, and government/enterprise applications.

As distributed databases evolve, they face new challenges that require continuous breakthroughs. For example, under high concurrency, database sessions across multiple nodes often lock each other’s resources, creating circular wait chains—a distributed global deadlock.

To allow transactions to proceed, the distributed database must provide fast deadlock detection and resolution.

Traditional approaches involve deploying a global deadlock process on CNs (Coordinators) and DNs (Data Nodes) that communicates with the GTM (Global Transaction Manager), periodically checking transaction wait relationships and sending results to the GTM to build a global wait-for graph. When a deadlock cycle is detected, the transaction with the largest transaction ID is rolled back, resolving the global deadlock.

However, this approach relies on a single GTM to collect wait relationships from all nodes. When the cluster scales and many transactions are running, the periodic check imposes heavy load, and deadlock detection latency increases, impacting database performance.

To address these issues, the GBase 8c development team proposed a deadlock detection and resolution method based on probe message passing, designed to resolve deadlocks in distributed systems.

Specifically, in GBase 8c, when a transaction’s CN process receives a probe message it originally sent, it indicates a global deadlock. The CN process then rolls back the transaction, releasing the locks it held so other transactions can proceed. Once the transaction is rolled back, the deadlock wait cycle is broken—eliminating the circular wait and resolving the deadlock. This decentralized design avoids any single point of failure that could cause deadlock detection to fail or be delayed.

GBase has applied for a patent for this technology, and the application has been accepted by the China National Intellectual Property Administration (CNIPA).

Distributed databases are facing historic opportunities and significant challenges. To keep pace with accelerating digital transformation, GBase 8c will continue to accelerate product innovation, enhance performance, and drive the prosperity of China’s big data ecosystem.