Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query optimization, and usability that you won’t want to miss.

Operations that Take Either a Database or a Cluster Lock

Certain operations will take either a database lock or a cluster lock. This topic explains what these locks are, their impact, and the operations that use them.

Database Locks

  • A database lock is taken on the database that the operation is operating on. While a database is locked, no other operations can lock the same database.
  • A database lock can be taken concurrently with locks on other databases.
  • If a database lock is taken, it will block a cluster lock from being taken.
  • Any blocked operations will queue.
  • Example: Database a takes a shared lock to perform CREATE DATABASE. Database b takes a shared lock to perform BACKUP DATABASE concurrently.

Cluster Locks

  • Only one cluster lock can be taken at a time.
  • If a cluster lock is taken, it will block any database locks from being taken.
  • Any blocked operations will queue.
  • Example: ADD LEAF is running on the cluster. While the operation is running, CREATE TABLE tries to run, but is blocked until ADD LEAF completes.

Operations that Take Database Locks

The following operations take database locks:

  • ALTER DATABASE
  • ALTER TABLE
  • ALTER VIEW
  • BACKUP DATABASE
  • CREATE DATABASE
  • CREATE INDEX
  • CREATE VIEW
  • DROP DATABASE
  • DROP INDEX
  • DROP VIEW
  • REBALANCE PARTITIONS
  • RESTORE DATABASE
  • RESTORE REDUNDANCY
  • OPTIMIZE TABLE (for rowstore tables only)
  • TRUNCATE

Operations that Take Cluster Locks

The following operations take cluster locks:

  • ADD AGGREGATOR
  • ADD LEAF
  • AGGREGATOR SET AS MASTER
  • ATTACH LEAF
  • ATTACH LEAF ALL
  • BOOTSTRAP AGGREGATOR
  • CHECK BLOB CHECKSUM
  • CLEAR ORPHAN DATABASES
  • CONTINUE REPLICATING
  • DETACH LEAF
  • PAUSE REPLICATING
  • REBALANCE ALL DATABASES
  • REMOVE AGGREGATOR
  • REMOVE LEAF
  • REPLICATE DATABASE
  • STOP REPLICATING