Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
93901: kvstorage: add package r=pavelkalinnikov a=tbg

We need a place for logic and testing of the engine interactions for the
separate raft log to live. This is this place.

Epic: CRDB-220

Co-authored-by: Tobias Grieger <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Dec 20, 2022
2 parents 50c064e + 28288d2 commit 6eddf3e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
/pkg/kv/kvserver/kvadmission/ @cockroachdb/kv-prs
/pkg/kv/kvserver/kvserverbase/ @cockroachdb/kv-prs
/pkg/kv/kvserver/kvserverpb/ @cockroachdb/kv-prs
/pkg/kv/kvserver/kvstorage/ @cockroachdb/repl-prs
/pkg/kv/kvserver/liveness/ @cockroachdb/kv-prs
/pkg/kv/kvserver/logstore/ @cockroachdb/repl-prs
/pkg/kv/kvserver/loqrecovery/ @cockroachdb/repl-prs
Expand Down
2 changes: 2 additions & 0 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ GO_TARGETS = [
"//pkg/kv/kvserver/kvadmission:kvadmission",
"//pkg/kv/kvserver/kvserverbase:kvserverbase",
"//pkg/kv/kvserver/kvserverpb:kvserverpb",
"//pkg/kv/kvserver/kvstorage:kvstorage",
"//pkg/kv/kvserver/liveness/livenesspb:livenesspb",
"//pkg/kv/kvserver/liveness:liveness",
"//pkg/kv/kvserver/liveness:liveness_test",
Expand Down Expand Up @@ -2529,6 +2530,7 @@ GET_X_DATA_TARGETS = [
"//pkg/kv/kvserver/kvadmission:get_x_data",
"//pkg/kv/kvserver/kvserverbase:get_x_data",
"//pkg/kv/kvserver/kvserverpb:get_x_data",
"//pkg/kv/kvserver/kvstorage:get_x_data",
"//pkg/kv/kvserver/liveness:get_x_data",
"//pkg/kv/kvserver/liveness/livenesspb:get_x_data",
"//pkg/kv/kvserver/logstore:get_x_data",
Expand Down
11 changes: 11 additions & 0 deletions pkg/kv/kvserver/kvstorage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
load("//build/bazelutil/unused_checker:unused.bzl", "get_x_data")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "kvstorage",
srcs = ["doc.go"],
importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvstorage",
visibility = ["//visibility:public"],
)

get_x_data(name = "get_x_data")
22 changes: 22 additions & 0 deletions pkg/kv/kvserver/kvstorage/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

// Package kvstorage houses the logic that manages the on-disk state for the
// Replicas housed on a Store. Replicas store data in two storage.Engine
// instances, which are optionally (and at the time of writing, always)
// identical. One Engine, the "log storage", stores Raft-related state (such as
// the raft log), while the other engine stores the replicated keyspace.
//
// The ability to separate log and state machine opens up performance
// improvements, but results in a more complex lifecycle where operations that
// need to update both the state machine and the raft state require more complex
// recovery in the event of an ill-timed crash. Encapsulating and testing this
// logic is the raison d'être for this package.
package kvstorage

0 comments on commit 6eddf3e

Please sign in to comment.