Dive Deep Into TiKV Transactions: The Life Story of a TiKV Prewrite Request

TiKV is a distributed key-value storage engine, which is based on the designs of Google Spanner, F1, and HBase. However, TiKV is much simpler to manage because it does not depend on a distributed file system.

As introduced in A Deep Dive into TiKV and How TiKV Reads and Writes, TiKV applies a 2-phase commit (2PC) algorithm inspired by Google Percolator to support distributed transactions. These two phases are Prewrite and Commit.

The Curious Case of Dead-End-Lock(Deadlock) | MySql

Usually, deadlocks are hard to debug, and often the main reason for the occurrence of deadlock is when a set of processes are in a wait state because each process is waiting for a resource that is held by some other waiting process. Therefore, all deadlocks involve conflicting resource needs by two or more processes.

Recently, in the Production system, we found a case wherein one of the API was getting a lot of failure of transactions due to deadlock. Strange thing was that it was not a total freeze deadlock of threads instead out of two conflicting transactions one was getting successfully completed.

Deleting Lost Transactions in MS SQL Server (Part 2)

In the first part, we presented the general algorithm for deleting open transactions that are not completed from a SQL Server database and considered the process of creating a table to record incomplete transactions. Now, let’s look at the process of creating a CRUD stored procedure to find and delete active transactions in SQL Server.

To perform the remaining steps of the algorithm, we’ll implement the stored procedure [srv]. [AutoKillSessionTranBegin].

Deleting Lost Transactions in MS SQL Server

Introduction

Quite often, transactions in MS SQL Server are lost by those who launched them. It is not infrequent that one runs a script in SSMS, which starts an explicit transaction with the BEGIN TRANSACTION statement, but then an error occurs and COMMIT TRANSACTION or ROLLBACK TRANSACTION fails while the transaction initiator has left this query for some time. Transactions left forgotten for long periods of time can prevent users from accessing the locked resources (tables, server resources (RAM, CPU, I / O system).

In this article, we will consider how to delete lost transactions using SQL Complete.