forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: add interfaces for copysets
Copysets significantly reduce the probability of data loss in the presence of multi node failures. The RFC for copysets is presented in cockroachdb#32816. This commit adds interfaces and protos for copysets. The implementation added later will have two independent tracks: 1. Assignment and persistance of store_id-copyset_id mapping. 2. Rebalancer changes to rebalance replicas into copysets. Release note: None
- Loading branch information
Vijay Karthik
committed
Jan 22, 2019
1 parent
7983048
commit 945ebd9
Showing
4 changed files
with
1,166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2018 The Cockroach Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package storage | ||
|
||
import "context" | ||
|
||
// copysetsReader is used to read copysets in the cluster. | ||
type copysetsReader interface { | ||
// forRF returns copysets for the given replication factor. | ||
forRF(ctx context.Context, replicationFactor int32) (*Copysets, error) | ||
} | ||
|
||
// CopysetsMaintainer maintains and assigns copysets to stores. | ||
// TODO(hassan): implement CopysetsMaintainer. | ||
type CopysetsMaintainer struct { | ||
} | ||
|
||
// Ensure CopysetsMaintainer implements copysetsReader. | ||
var _ copysetsReader = &CopysetsMaintainer{} | ||
|
||
// forRF returns copysets for the given replication factor. | ||
func (cs *CopysetsMaintainer) forRF( | ||
ctx context.Context, replicationFactor int32, | ||
) (*Copysets, error) { | ||
return nil, nil | ||
} |
Oops, something went wrong.