diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2f6720517a39..52b1f4e792f2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -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 diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index 527b4dbbee3f..8de1634b1a4d 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -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", @@ -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", diff --git a/pkg/kv/kvserver/kvstorage/BUILD.bazel b/pkg/kv/kvserver/kvstorage/BUILD.bazel new file mode 100644 index 000000000000..a17f50ad0b76 --- /dev/null +++ b/pkg/kv/kvserver/kvstorage/BUILD.bazel @@ -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") diff --git a/pkg/kv/kvserver/kvstorage/doc.go b/pkg/kv/kvserver/kvstorage/doc.go new file mode 100644 index 000000000000..dc4d9d8c17cb --- /dev/null +++ b/pkg/kv/kvserver/kvstorage/doc.go @@ -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