semisyncmonitor

package
v0.22.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

Monitor is a monitor that checks if the primary tablet is blocked on a semi-sync ack from the replica. If the semi-sync ACK is lost in the network, it is possible that the primary is indefinitely stuck, blocking PRS. The monitor looks for this situation and manufactures a write periodically to unblock the primary.

func CreateTestSemiSyncMonitor

func CreateTestSemiSyncMonitor(db *fakesqldb.DB, exporter *servenv.Exporter) *Monitor

CreateTestSemiSyncMonitor created a monitor for testing. It takes an optional fake db.

func NewMonitor

func NewMonitor(config *tabletenv.TabletConfig, exporter *servenv.Exporter) *Monitor

NewMonitor creates a new Monitor.

func (*Monitor) AllWritesBlocked

func (m *Monitor) AllWritesBlocked() bool

AllWritesBlocked returns if maxWritesPermitted number of writes are already outstanding.

func (*Monitor) Close

func (m *Monitor) Close()

Close stops the monitor.

func (*Monitor) Open

func (m *Monitor) Open()

Open starts the monitor.

func (*Monitor) WaitUntilSemiSyncUnblocked

func (m *Monitor) WaitUntilSemiSyncUnblocked(ctx context.Context) error

WaitUntilSemiSyncUnblocked waits until the primary is not blocked on semi-sync or until the context expires.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL