Raft Witness Node and Witness Replica

Introduction

Oracle Globally Distributed AI Database supports Raft replication in witness mode, in which each replication unit (RU) consists of two full replicas and one witness replica.

In a standard RF=3 topology, all three replicas store a full copy of the table partition. In witness mode, the witness replica retains the Raft consensus module but stores only a portion of the Raft log and does not contain a table partition. This reduces storage requirements while allowing the witness to participate in Raft consensus.

Standard RF=3 topology without a witness node

RF=3 topology with a witness node

Witness replicas:

A witness replica:

Supported Failure Scenarios

For a topology with two full replicas and one witness:

Benefits and Use Cases

A witness replica cannot serve application requests, add read capacity, or provide an independent full data copy for recovery.

Adding Witness Replicas

Witness replicas are added to the distributed database when shard groups are added to the topology. For example:

GDSCTL> add shardgroup -shardgroup shgrp1 -repfactor 2 -witnesses 1

Note the following:

The following example shows a full topology configuration:

GDSCTL> create shardcatalog -database cataloghost.example.com:1521/catalogpdb.example.com -user mysdbadmin/gsmcatuser_password -region dc1 -repl native -chunks 30
GDSCTL> add gsm -gsm gsm1 -listener 1540 -catalog cataloghost.example.com:1521/catalogpdb.example.com -region dc1 -pwd gsmcatuser_password
GDSCTL> start gsm -gsm gsm1
GDSCTL> add shardgroup -shardgroup shgrp1 -region dc1 -repfactor 2 -witnesses 1
GDSCTL> add cdb -connect shardhost1.example.com:1521/cdb1.example.com -pwd gsmrootuser_password
GDSCTL> add shard -cdb cdb1 -shardgroup shgrp1 -connect shardhost1.example.com:1521/pdb1.example.com -pwd gsmuser_password
GDSCTL> add cdb -connect shardhost2.example.com:1521/cdb2.example.com -pwd gsmrootuser_password
GDSCTL> add shard -cdb cdb2 -shardgroup shgrp1 -connect shardhost2.example.com:1521/pdb2.example.com -pwd gsmuser_password
GDSCTL> add cdb -connect shardhost3.example.com:1521/cdb3.example.com -pwd gsmrootuser_password
GDSCTL> add shard -cdb cdb3 -shardgroup shgrp1 -connect shardhost3.example.com:1521/pdb3.example.com -pwd gsmuser_password
GDSCTL> deploy

After deployment, the topology contains leader (L), follower (F), and witness (W) replicas. The source document includes diagrams for the standard RF=3 topology and the resulting topology with a witness replica.

RF=3 topology with a witness node