Improve readability
Signed-off-by: Ryan Russell <ryanrussell@users.noreply.github.com>
This commit is contained in:
committed by
Ben Johnson
parent
31aa5b34f6
commit
2acdab02c8
@@ -105,7 +105,7 @@ func (r *Replica) Client() ReplicaClient { return r.client }
|
|||||||
|
|
||||||
// Starts replicating in a background goroutine.
|
// Starts replicating in a background goroutine.
|
||||||
func (r *Replica) Start(ctx context.Context) {
|
func (r *Replica) Start(ctx context.Context) {
|
||||||
// Ignore if replica is being used sychronously.
|
// Ignore if replica is being used synchronously.
|
||||||
if !r.MonitorEnabled {
|
if !r.MonitorEnabled {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ import (
|
|||||||
// WALDownloader represents a parallel downloader of WAL files from a replica client.
|
// WALDownloader represents a parallel downloader of WAL files from a replica client.
|
||||||
//
|
//
|
||||||
// It works on a per-index level so WAL files are always downloaded in their
|
// It works on a per-index level so WAL files are always downloaded in their
|
||||||
// entirety and are not segmented. WAL files are downloaded from minIndex to
|
// entiretry and are not segmented. WAL files are downloaded from minIndex to
|
||||||
// maxIndex, inclusively, and are written to a path prefix. WAL files are named
|
// maxIndex, inclusively, and are written to a path prefix. WAL files are named
|
||||||
// with the prefix and suffixed with the WAL index. It is the responsibility of
|
// with the prefix and suffixed with the WAL index. It is the responsibility of
|
||||||
// the caller to clean up these WAL files.
|
// the caller to clean up these WAL files.
|
||||||
//
|
//
|
||||||
// The purpose of the parallization is that RTT & WAL apply time can consume
|
// The purpose of the parallelization is that RTT & WAL apply time can consume
|
||||||
// much of the restore time so it's useful to download multiple WAL files in
|
// much of the restore time so it's useful to download multiple WAL files in
|
||||||
// the background to minimize the latency. While some WAL indexes may be
|
// the background to minimize the latency. While some WAL indexes may be
|
||||||
// downloaded out of order, the WALDownloader ensures that Next() always
|
// downloaded out of order, the WALDownloader ensures that Next() always
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ func testWALDownloader(t *testing.T, parallelism int) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Ensure a gap in indicies returns an error.
|
// Ensure a gap in indices returns an error.
|
||||||
t.Run("ErrMissingMiddleIndex", func(t *testing.T) {
|
t.Run("ErrMissingMiddleIndex", func(t *testing.T) {
|
||||||
testDir := filepath.Join("testdata", "wal-downloader", "missing-middle-index")
|
testDir := filepath.Join("testdata", "wal-downloader", "missing-middle-index")
|
||||||
tempDir := t.TempDir()
|
tempDir := t.TempDir()
|
||||||
|
|||||||
Reference in New Issue
Block a user