Skip to content

Commit

Permalink
wal,record: failover write path code
Browse files Browse the repository at this point in the history
failover_manager.go contains the failoverManager (which implements
wal.Manager) for the write path, and helper classes. dirProber monitors
the primary dir when failed over to use the secondary, to decide when to
failback to the primary. failoverMonitor uses the latency and error seen
by the current *LogWriter, and probing state, to decide when to switch to
a different dir.

failover_writer.go contains the failoverWriter, that can switch across
a sequence of record.LogWriters.

record.LogWriter is changed to accommodate both standalone and failover
mode, without affecting the synchronization in standalone mode.
In failover mode there is some additional synchronization, in the
failoverWriter queue, which is not lock free, but is hopefully fast
enough given the fastpath will use read locks.

Informs cockroachdb#3230
  • Loading branch information
sumeerbhola committed Jan 23, 2024
1 parent 5b09251 commit 2802acd
Show file tree
Hide file tree
Showing 7 changed files with 1,625 additions and 40 deletions.
Loading

0 comments on commit 2802acd

Please sign in to comment.