Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wal: separate read interface from Manager #3312

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Feb 16, 2024

This commit separates the interface for reading WAL files from the Manager interface. This helps unify some code on the read path, but it also makes it easier to support changing configuration (eg, changing secondary location or disabling failover).

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jbowens jbowens force-pushed the wal-read branch 2 times, most recently from 866a147 to 739a233 Compare February 16, 2024 23:42
@jbowens jbowens requested review from sumeerbhola and a team February 16, 2024 23:45
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jbowens)


wal/failover_manager.go line 447 at r1 (raw file):

// List implements Manager.
func (wm *failoverManager) List() (Logs, error) {
	return Scan(wm.opts.Primary, wm.opts.Secondary)

I suppose since we don't have anything like StandaloneManager.mu.queue we have to go to the filesystem. And this may change once we implement stats etc.?


wal/reader.go line 44 at r1 (raw file):

}

// NumSegments returns the number of consitutent physical log files that make up

nit: constituent

This commit separates the interface for reading WAL files from the Manager
interface.  This helps unify some code on the read path, but it also makes it
easier to support changing configuration (eg, changing secondary location or
disabling failover).
Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

Reviewable status: 9 of 10 files reviewed, 1 unresolved discussion (waiting on @sumeerbhola)


wal/failover_manager.go line 447 at r1 (raw file):

Previously, sumeerbhola wrote…

I suppose since we don't have anything like StandaloneManager.mu.queue we have to go to the filesystem. And this may change once we implement stats etc.?

Yeah, I think it might—there's also the ambiguity as to whether the files that we know we've attempted to create actually do exist. I haven't thought through that stats plumbing.


wal/reader.go line 44 at r1 (raw file):

Previously, sumeerbhola wrote…

nit: constituent

Done.

@jbowens jbowens merged commit 8f7b7f8 into cockroachdb:master Feb 20, 2024
11 checks passed
@jbowens jbowens deleted the wal-read branch February 20, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants