diff --git a/seaweed-block/cmd/sw-block/chunk_volume_delete.go b/seaweed-block/cmd/sw-block/chunk_volume_delete.go index 6d6497b916..1c64d169ac 100644 --- a/seaweed-block/cmd/sw-block/chunk_volume_delete.go +++ b/seaweed-block/cmd/sw-block/chunk_volume_delete.go @@ -2,6 +2,8 @@ package main import ( "context" + "crypto/rand" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -9,7 +11,9 @@ import ( "time" "google.golang.org/grpc" + "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore" "github.com/seaweedfs/seaweed-block/core/ops" @@ -53,10 +57,9 @@ func chunkVolumeDelete(args []string, stdout, stderr io.Writer) int { return chunkResult("volume-delete", nil, err, stdout, stderr) } defer conn.Close() - lifecycle := control.NewLifecycleServiceClient(conn) - admit := func(ctx context.Context, vol string) error { - _, err := lifecycle.MarkVolumeDeleting(ctx, &control.MarkVolumeDeletingRequest{VolumeId: vol}) - return err + admit, err := newMasterAdmission(control.NewLifecycleServiceClient(conn)) + if err != nil { + return chunkResult("volume-delete", nil, err, stdout, stderr) } ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() @@ -67,6 +70,53 @@ func chunkVolumeDelete(args []string, stdout, stderr io.Writer) int { return chunkResult("volume-delete", res, nil, stdout, stderr) } +// masterAdmission is the delete's reservation at the blockmaster, under +// one random token per delete. +type masterAdmission struct { + lc control.LifecycleServiceClient + token string +} + +func newMasterAdmission(lc control.LifecycleServiceClient) (*masterAdmission, error) { + var b [12]byte + if _, err := rand.Read(b[:]); err != nil { + return nil, err + } + return &masterAdmission{lc: lc, token: hex.EncodeToString(b[:])}, nil +} + +func (m *masterAdmission) req(vol string) *control.MarkVolumeDeletingRequest { + return &control.MarkVolumeDeletingRequest{VolumeId: vol, Token: m.token} +} + +// admissionErr: FailedPrecondition and InvalidArgument are definite +// refusals; anything else (unavailable, deadline, a lost response) leaves +// the outcome unknown. +func admissionErr(err error) error { + switch status.Code(err) { + case codes.OK: + return nil + case codes.FailedPrecondition, codes.InvalidArgument: + return fmt.Errorf("%w: %v", chunkstore.ErrNotAdmitted, err) + } + return err +} + +func (m *masterAdmission) Admit(ctx context.Context, vol string) error { + _, err := m.lc.MarkVolumeDeleting(ctx, m.req(vol)) + return admissionErr(err) +} + +func (m *masterAdmission) Commit(ctx context.Context, vol string) error { + _, err := m.lc.CommitVolumeDeleting(ctx, m.req(vol)) + return err +} + +func (m *masterAdmission) Abort(ctx context.Context, vol string) error { + _, err := m.lc.AbortVolumeDeleting(ctx, m.req(vol)) + return err +} + // volumeDeletePartial prints what a failed delete did, with the error, and // fails. func volumeDeletePartial(res chunkstore.VolumeDeleteResult, err error, stdout, stderr io.Writer) int { diff --git a/seaweed-block/cmd/sw-block/chunk_volume_delete_test.go b/seaweed-block/cmd/sw-block/chunk_volume_delete_test.go index 9ffc0cca1e..1378988546 100644 --- a/seaweed-block/cmd/sw-block/chunk_volume_delete_test.go +++ b/seaweed-block/cmd/sw-block/chunk_volume_delete_test.go @@ -7,8 +7,14 @@ import ( "testing" "time" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" + "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore" "github.com/seaweedfs/seaweed-block/core/host/master" + "github.com/seaweedfs/seaweed-block/core/rpc/control" "github.com/seaweedfs/seaweed-block/core/storage" ) @@ -73,8 +79,44 @@ func TestOpsChunk_VolumeDelete(t *testing.T) { chunkstore.VolumeDeleteResult Error *chunkErrBody `json:"error"` } - if code == 0 || json.Unmarshal([]byte(out), &partial) != nil || partial.Error == nil || partial.Error.Code != chunkstore.CodeVolumeInUse || !partial.Admitted || partial.HeadMarked || partial.Completed { - t.Fatalf("delete of attached v2: %d %q; want volume_in_use with the partial result", code, out) + if code == 0 || json.Unmarshal([]byte(out), &partial) != nil || partial.Error == nil || partial.Error.Code != chunkstore.CodeVolumeInUse || !partial.Admitted || !partial.AdmissionAborted || partial.HeadMarked || partial.Completed { + t.Fatalf("delete of attached v2: %d %q; want volume_in_use with the partial result, admission given back", code, out) + } + lc := lifecycleClient(t, h.Addr()) + // The given-back id is usable at the master again. + if _, err := lc.CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "v2", SizeBytes: 1 << 20, ReplicationFactor: 1}); err != nil { + t.Fatalf("create v2 after its delete gave back: %v", err) + } + + // Integrated claim refusal: v3 has a snapshot a real, incomplete fork + // claims (VOLUME published, stopped before HEAD by its deadline). + if _, err := cat.EnsureVolume(ctx, "v3", geo); err != nil { + t.Fatal(err) + } + h3, _, err := cat.ReadHead(ctx, "v3") + if err != nil { + t.Fatal(err) + } + if _, err := cat.CreateSnapshot(ctx, "v3", chunkstore.SnapshotRequest{Name: "s", RequestID: "rs"}, h3); err != nil { + t.Fatal(err) + } + clock := time.Now() + cat.SetClock(func() time.Time { clock = clock.Add(time.Second); return clock }) + cat.OpDeadline = time.Nanosecond + if _, err := cat.Fork(ctx, chunkstore.ForkRequest{Source: "v3", Snapshot: "s", Target: "w3", RequestID: "f"}); chunkstore.CodeOf(err) != chunkstore.CodeDeadlineExceeded { + t.Fatalf("stopped fork: %v", err) + } + cat.OpDeadline = 0 + code, out, _ = runChunk("volume-delete", "--chunk-filer", "f:1", "--master", h.Addr(), "v3") + partial.Error = nil + if code == 0 || json.Unmarshal([]byte(out), &partial) != nil || partial.Error == nil || partial.Error.Code != chunkstore.CodeSnapshotClaimed || !partial.Reverted || !partial.AdmissionAborted { + t.Fatalf("delete of claimed v3: %d %q; want snapshot_claimed, reverted, admission given back", code, out) + } + if _, err := lc.CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "v3", SizeBytes: 1 << 20, ReplicationFactor: 1}); err != nil { + t.Fatalf("create v3 after the claim refusal: %v; want usable again", err) + } + if _, err := cat.EnsureVolume(ctx, "v3", geo); err != nil { + t.Fatalf("attach v3 after the claim refusal: %v; want usable again", err) } code, out, errs := runChunk("volume-delete", "--chunk-filer", "f:1", "--master", h.Addr(), "v1") var res chunkstore.VolumeDeleteResult @@ -84,4 +126,20 @@ func TestOpsChunk_VolumeDelete(t *testing.T) { if _, err := cat.EnsureVolume(ctx, "v1", geo); chunkstore.CodeOf(err) != chunkstore.CodeVolumeDeleted { t.Fatalf("recreate v1: %v; want volume_deleted", err) } + if !res.Committed { + t.Fatalf("delete v1: %+v; want committed", res) + } + if _, err := lc.CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "v1", SizeBytes: 1 << 20, ReplicationFactor: 1}); status.Code(err) != codes.FailedPrecondition { + t.Fatalf("create v1 after its committed delete: %v; want FailedPrecondition", err) + } +} + +func lifecycleClient(t *testing.T, addr string) control.LifecycleServiceClient { + t.Helper() + c, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { c.Close() }) + return control.NewLifecycleServiceClient(c) } diff --git a/seaweed-block/core/frontend/chunkstore/catalog.go b/seaweed-block/core/frontend/chunkstore/catalog.go index c6c4241eea..9859db5955 100644 --- a/seaweed-block/core/frontend/chunkstore/catalog.go +++ b/seaweed-block/core/frontend/chunkstore/catalog.go @@ -853,7 +853,17 @@ func (c *Catalog) CreateSnapshot(ctx context.Context, vol string, req SnapshotRe if gone, err := c.volumeGone(ctx, vol); err != nil { return SnapshotInfo{}, err } else if gone { - c.abandonUnpublished(ctx, vol, root, req.Name, attempt) + // Settle this name as the delete does: the attempt's tombstone or + // its winning publication is confirmed before the name is freed; + // on failure the name stays, so the delete still finds it. + if red := true; red { // RED: the name is freed even when the abort write failed + if tomb, err := c.abortedSnapEntry(vol, req.Name, attempt); err == nil { + _ = c.f.CreateEntry(ctx, path.Join(root, snapsDir, req.Name), tomb, true) + } + _, _, _ = c.freeName(ctx, root, req.Name, attempt) + } else { + _, _, _, _ = c.deleteNameForVolume(ctx, vol, root, req.Name) + } return SnapshotInfo{}, refuseDeleted(vol, "it cannot be snapshotted") } @@ -1358,17 +1368,6 @@ func (c *Catalog) dropForkClaim(ctx context.Context, req ForkRequest, attempt st _, _ = c.removeForkClaim(ctx, req, attempt) } -// abandonUnpublished gives up an attempt that was never published: an -// aborted tombstone at its path (so a late create cannot land), then the -// name freed while it names that attempt (best effort; a delete's own pass -// does the same). -func (c *Catalog) abandonUnpublished(ctx context.Context, vol, root, name, attempt string) { - if tomb, err := c.abortedSnapEntry(vol, name, attempt); err == nil { - _ = c.f.CreateEntry(ctx, path.Join(root, snapsDir, name), tomb, true) - } - _, _, _ = c.freeName(ctx, root, name, attempt) -} - // removeForkClaim removes fork req's claim from its parent attempt and // reports whether this call confirmed its removal (false with no error: // the claim was not there). diff --git a/seaweed-block/core/frontend/chunkstore/chunk_remote.go b/seaweed-block/core/frontend/chunkstore/chunk_remote.go index 9adb0ddcb8..882a3df71e 100644 --- a/seaweed-block/core/frontend/chunkstore/chunk_remote.go +++ b/seaweed-block/core/frontend/chunkstore/chunk_remote.go @@ -384,7 +384,7 @@ func (r *ChunkRemote) CASHead(ctx context.Context, expected storage.ChunkHeadVer if err != nil { return 0, err } - if current.State == storage.ChunkHeadDeleting || current.State == storage.ChunkHeadDeleted { + if current.State == storage.ChunkHeadDeleting || current.State == storage.ChunkHeadPurging || current.State == storage.ChunkHeadDeleted { // A delete passed its linearization point: nothing moves this HEAD // again (the catalog writes the delete's own transitions). return 0, fmt.Errorf("%w: %w", storage.ErrChunkHeadPrecondition, storage.ErrChunkHeadDeleted) @@ -502,9 +502,9 @@ func decodeHeadDoc(p string, content []byte) (storage.ChunkHead, error) { if doc.DetachedBy != nil || len(doc.Chunks) != 0 { return fail("an aborted HEAD with content") } - case storage.ChunkHeadDeleting: - // A delete's linearization mark over the HEAD it read: content and - // any detach record kept (a revert restores them). + case storage.ChunkHeadDeleting, storage.ChunkHeadPurging: + // A delete's mark over the HEAD it read (deleting: still revertible; + // purging: committed): content and any detach record kept. case storage.ChunkHeadDeleted: // A deleted volume's tombstone (no chunks, no holder). if doc.DetachedBy != nil || len(doc.Chunks) != 0 || doc.Holder != "" { diff --git a/seaweed-block/core/frontend/chunkstore/volume_delete.go b/seaweed-block/core/frontend/chunkstore/volume_delete.go index 8f8be4099e..fd95e4ef06 100644 --- a/seaweed-block/core/frontend/chunkstore/volume_delete.go +++ b/seaweed-block/core/frontend/chunkstore/volume_delete.go @@ -15,10 +15,12 @@ import ( // Volume delete (claude05's item, 2026-11-16 02:39Z; one linearization // point per codex01's review of 7c43367). // -// (a) Admission: the caller's Admission (the CLI's is the blockmaster's -// MarkVolumeDeleting: refused while the volume has live or pending -// authority; once it passes, no new assignment, placement or binding -// is admitted and the id is never created again). +// (a) Admission: the caller's Admission (the CLI's: the blockmaster's +// durable deletion reservation, MarkVolumeDeleting; refused while the +// volume has live or pending authority; while held, no new assignment, +// placement or binding is admitted and the id is not created again). +// Every give-back below aborts this delete's admission (restoring the +// volume's usability); the commit point commits it (permanent). // (b) The linearization point: one conditional write of HEAD from the // HEAD read (active or detached, NOT held: an active HEAD that names a // holder belongs to an attached server) to state deleting, chunks @@ -30,6 +32,11 @@ import ( // previous state (nothing irreversible was done) and refuses // (snapshot_claimed). A fork claiming later sees the deleting HEAD // and gives its claim back. +// (c') The commit point: HEAD deleting -> purging, conditioned on the +// HEAD read, then the admission is committed. A revert and a commit +// race on the same conditional write, so a delete that sampled a +// claim can never undo another delete's irreversible steps, and a +// delete whose mark was given back never starts them. // (d) Only then the irreversible steps: every snapshot name, published or // not (an unpublished attempt gets an aborted tombstone so its late // publish cannot land), is marked through markDeleting (the one mark @@ -52,24 +59,42 @@ const ( // Test seams (retainHook stages) in a DeleteVolume. hookHeadMarked = "head-marked" // after (b) - hookClaimsChecked = "claims-checked" // after (c) + hookClaimFound = "claim-found" // (c) found a live claim, before the revert + hookClaimsChecked = "claims-checked" // after (c), before the commit point ) -// Admission admits a volume delete before anything is written; its error -// refuses the delete (volume_in_use). -type Admission func(ctx context.Context, vol string) error +// ErrNotAdmitted marks an Admission error that is a definite refusal +// (nothing was recorded). Any other Admission error leaves the outcome +// unknown. +var ErrNotAdmitted = errors.New("chunkstore: volume delete not admitted") + +// Admission is the delete's reservation outside the catalog (the CLI's is +// the blockmaster's). Admit before anything is written; Commit at the +// irreversible boundary; Abort when the delete gives back with no +// irreversible effect. +type Admission interface { + Admit(ctx context.Context, vol string) error + Commit(ctx context.Context, vol string) error + Abort(ctx context.Context, vol string) error +} // VolumeDeleteResult is what DeleteVolume did, also on failure. type VolumeDeleteResult struct { - VolumeID string `json:"volumeID"` - Replayed bool `json:"replayed"` // it was already deleted - Admitted bool `json:"admitted"` // (a) passed - HeadMarked bool `json:"headMarked"` // HEAD is deleting or deleted - Reverted bool `json:"reverted"` // (c) gave the HEAD mark back - SnapshotsDeleted []string `json:"snapshotsDeleted"` - AttemptsAborted []string `json:"attemptsAborted"` // unpublished attempts tombstoned - ClaimReleased bool `json:"claimReleased"` // its fork claim was confirmed removed - Completed bool `json:"completed"` // HEAD and VOLUME are deleted + VolumeID string `json:"volumeID"` + Replayed bool `json:"replayed"` // it was already deleted + Admitted bool `json:"admitted"` // (a) passed + // AdmissionUncertain: the admission call failed with an unknown + // outcome (it may have been recorded); AdmissionAborted: this delete + // gave its admission back; Committed: the admission is permanent. + AdmissionUncertain bool `json:"admissionUncertain"` + AdmissionAborted bool `json:"admissionAborted"` + Committed bool `json:"committed"` + HeadMarked bool `json:"headMarked"` // HEAD is deleting or deleted + Reverted bool `json:"reverted"` // (c) gave the HEAD mark back + SnapshotsDeleted []string `json:"snapshotsDeleted"` + AttemptsAborted []string `json:"attemptsAborted"` // unpublished attempts tombstoned + ClaimReleased bool `json:"claimReleased"` // its fork claim was confirmed removed + Completed bool `json:"completed"` // HEAD and VOLUME are deleted // Uncertain is set when the failing call was a write whose outcome is // unknown; a rerun settles it. Uncertain bool `json:"uncertain"` @@ -95,41 +120,83 @@ func (c *Catalog) DeleteVolume(ctx context.Context, vol string, admit Admission) return res, err } res.Replayed = v.State == VolumeDeleted && h.State == storage.ChunkHeadDeleted - marked := h.State == storage.ChunkHeadDeleting || h.State == storage.ChunkHeadDeleted - // (a) - if !marked && admit != nil { - if err := admit(ctx, vol); err != nil { - return res, catErr(CodeVolumeInUse, false, err, "volume %s: delete not admitted", vol) + // (a) Every call takes its own admission (a rerun too: it settles a + // commit an earlier run may have lost). + if admit != nil { + if err := admit.Admit(ctx, vol); err != nil { + if errors.Is(err, ErrNotAdmitted) || true { // RED: any admission error reads as a refusal + return res, catErr(CodeVolumeInUse, false, err, "volume %s: delete not admitted", vol) + } + res.AdmissionUncertain, res.Uncertain = true, true + return res, catErr(CodeOutcomeUnknown, true, err, "volume %s: delete admission outcome unknown (it may be recorded); rerun the delete", vol) } } res.Admitted = true + giveBack := func(cause error) (VolumeDeleteResult, error) { + if red := true; red { // RED: a give-back leaves the admission in place + return res, cause + } + if admit != nil { + if err := admit.Abort(ctx, vol); err != nil { + res.Uncertain = true + return res, catErr(CodeOutcomeUnknown, true, err, "volume %s: %v; giving the admission back failed, rerun the delete", vol, cause) + } + res.AdmissionAborted = true + } + return res, cause + } // (b) - if !marked { + if h.State != storage.ChunkHeadPurging && h.State != storage.ChunkHeadDeleted { u, err := c.markHeadDeleting(ctx, vol, root) if err != nil { - res.Uncertain = u - return res, err + if u { + res.Uncertain = true + return res, err + } + return giveBack(err) } - } - res.HeadMarked = true - c.hook(hookHeadMarked, vol) - // (c) - if h.State != storage.ChunkHeadDeleted { + res.HeadMarked = true + c.hook(hookHeadMarked, vol) + // (c) live, err := c.anyLiveClaim(ctx, vol) if err != nil { return res, err } if live != nil { - u, rerr := c.revertHeadDeleting(ctx, vol, root) - if rerr != nil { + c.hook(hookClaimFound, vol) + reverted, u, rerr := c.revertHeadDeleting(ctx, vol, root) + switch { + case rerr != nil: res.Uncertain = u return res, rerr + case !reverted && false: // RED: a revert that found the HEAD committed still counts as given back + // Another delete committed meanwhile: its irreversible steps + // stand; this call neither reverts nor gives back. + return res, catErr(CodeOutcomeUnknown, true, nil, "volume %s: another delete committed while this one found %v; rerun the delete", vol, live) } res.Reverted, res.HeadMarked = true, false - return res, live + return giveBack(live) + } + c.hook(hookClaimsChecked, vol) + // (c') the commit point + committed, u, err := c.commitHeadPurging(ctx, vol, root) + if err != nil { + res.Uncertain = u + return res, err + } + if !committed { + res.HeadMarked = false + return giveBack(catErr(CodeOutcomeUnknown, true, nil, "volume %s: a concurrent delete gave the mark back; rerun the delete", vol)) } } - c.hook(hookClaimsChecked, vol) + res.HeadMarked = true + if admit != nil { + if err := admit.Commit(ctx, vol); err != nil { + res.Uncertain = true + return res, catErr(CodeOutcomeUnknown, true, err, "volume %s: committing the admission failed; rerun the delete", vol) + } + } + res.Committed = true // (d) names, err := c.listNames(ctx, root) if err != nil { @@ -182,7 +249,7 @@ func headHeld(h storage.ChunkHead) bool { // headDeletingOrDeleted reports a HEAD a delete has passed its // linearization point on. func headDeletingOrDeleted(h storage.ChunkHead) bool { - return h.State == storage.ChunkHeadDeleting || h.State == storage.ChunkHeadDeleted + return h.State == storage.ChunkHeadDeleting || h.State == storage.ChunkHeadPurging || h.State == storage.ChunkHeadDeleted } // writeHead writes next over the HEAD read as cur (an exclusive create when @@ -241,15 +308,17 @@ func (c *Catalog) markHeadDeleting(ctx context.Context, vol, root string) (bool, } // revertHeadDeleting gives (b) back: deleting returns to detached when the -// HEAD carries its holder's detach record, else to active. -func (c *Catalog) revertHeadDeleting(ctx context.Context, vol, root string) (bool, error) { +// HEAD carries its holder's detach record, else to active. reverted is +// false when the HEAD is no longer deleting (another delete committed, or +// already gave it back). +func (c *Catalog) revertHeadDeleting(ctx context.Context, vol, root string) (reverted, uncertain bool, err error) { for try := 0; try < 5; try++ { h, _, err := c.ReadHead(ctx, vol) if err != nil { - return false, err + return false, false, err } if h.State != storage.ChunkHeadDeleting { - return false, nil + return h.State == storage.ChunkHeadActive || h.State == storage.ChunkHeadDetached || h.State == "", false, nil } next := h next.State = storage.ChunkHeadActive @@ -264,11 +333,41 @@ func (c *Catalog) revertHeadDeleting(ctx context.Context, vol, root string) (boo continue } if err != nil { - return true, catErr(CodeOutcomeUnknown, true, err, "revert the delete mark on HEAD of %s: outcome unknown; rerun the delete", vol) + return false, true, catErr(CodeOutcomeUnknown, true, err, "revert the delete mark on HEAD of %s: outcome unknown; rerun the delete", vol) } - return false, nil + return true, false, nil } - return false, remoteErr(nil, "HEAD of %s kept changing", vol) + return false, false, remoteErr(nil, "HEAD of %s kept changing", vol) +} + +// commitHeadPurging is the commit point: deleting -> purging, conditioned +// on the HEAD read. committed is false when the mark was given back (the +// HEAD is active or detached again). +func (c *Catalog) commitHeadPurging(ctx context.Context, vol, root string) (committed, uncertain bool, err error) { + for try := 0; try < 5; try++ { + h, _, err := c.ReadHead(ctx, vol) + if err != nil { + return false, false, err + } + switch h.State { + case storage.ChunkHeadPurging, storage.ChunkHeadDeleted: + return true, false, nil // committed (by this call's earlier try or another delete) + case storage.ChunkHeadDeleting: + default: + return false, false, nil + } + next := h + next.State = storage.ChunkHeadPurging + err = c.writeHead(ctx, root, h, next) + if lostCondition(err) { + continue + } + if err != nil { + return false, true, catErr(CodeOutcomeUnknown, true, err, "commit the delete of %s: outcome unknown; rerun the delete", vol) + } + return true, false, nil + } + return false, false, remoteErr(nil, "HEAD of %s kept changing", vol) } // finishHeadDeleted is (e) for HEAD: deleting becomes deleted, no chunks. @@ -281,8 +380,8 @@ func (c *Catalog) finishHeadDeleted(ctx context.Context, vol, root string) (bool if h.State == storage.ChunkHeadDeleted { return false, nil } - if h.State != storage.ChunkHeadDeleting { - return false, remoteErr(nil, "HEAD of %s left the deleting state (%q)", vol, h.State) + if h.State != storage.ChunkHeadPurging { + return false, remoteErr(nil, "HEAD of %s is not committed for deletion (%q)", vol, h.State) } next := storage.ChunkHead{Epoch: h.Epoch, RemoteLSN: h.RemoteLSN, Chunks: map[uint64]storage.ChunkRef{}, State: storage.ChunkHeadDeleted} err = c.writeHead(ctx, root, h, next) diff --git a/seaweed-block/core/frontend/chunkstore/volume_delete_test.go b/seaweed-block/core/frontend/chunkstore/volume_delete_test.go index a5fca1ab7a..c064dc7191 100644 --- a/seaweed-block/core/frontend/chunkstore/volume_delete_test.go +++ b/seaweed-block/core/frontend/chunkstore/volume_delete_test.go @@ -3,8 +3,10 @@ package chunkstore import ( "context" "errors" + "fmt" "path" "strings" + "sync" "testing" "github.com/seaweedfs/seaweed-block/core/frontend/chunkstore/filerpb" @@ -88,10 +90,9 @@ func TestCatalog_DeleteVolumeRefusesAVolumeInUse(t *testing.T) { } detachHead(t, f, b, "v1") before = len(f.allWritten()) - refuse := func(context.Context, string) error { return errors.New("assigned to r1") } - res, err := c.DeleteVolume(ctx, "v1", refuse) + res, err := c.DeleteVolume(ctx, "v1", (&fakeReservation{refuse: true}).admission("d1")) var ce *CatalogError - if !errors.As(err, &ce) || ce.Code != CodeVolumeInUse || ce.Retryable || !strings.Contains(ce.Detail(), "assigned to r1") || res.Admitted { + if !errors.As(err, &ce) || ce.Code != CodeVolumeInUse || ce.Retryable || !strings.Contains(ce.Detail(), "assigned to r1") || res.Admitted || res.AdmissionUncertain { t.Fatalf("delete the admission refuses: %+v %v; want volume_in_use naming the reason", res, err) } if got := len(f.allWritten()); got != before { @@ -218,9 +219,13 @@ func TestCatalog_DeleteVolumeGivesBackOnALiveClaim(t *testing.T) { } } } - res, err := c.DeleteVolume(ctx, "v1", nil) - if CodeOf(err) != CodeSnapshotClaimed || !res.Reverted || res.HeadMarked || len(res.SnapshotsDeleted) != 0 { - t.Fatalf("delete under a live claim: %+v %v; want snapshot_claimed, reverted", res, err) + rsv := &fakeReservation{} + res, err := c.DeleteVolume(ctx, "v1", rsv.admission("d1")) + if CodeOf(err) != CodeSnapshotClaimed || !res.Reverted || res.HeadMarked || len(res.SnapshotsDeleted) != 0 || !res.AdmissionAborted || res.Committed { + t.Fatalf("delete under a live claim: %+v %v; want snapshot_claimed, reverted, admission given back", res, err) + } + if rsv.state != "" { + t.Fatalf("reservation after the give-back: %q; want none (the volume is usable again)", rsv.state) } after := headState(t, c, "v1") if after.State != storage.ChunkHeadDetached || after.DetachedBy == nil || after.Holder != before.Holder || len(after.Chunks) != len(before.Chunks) { @@ -359,8 +364,9 @@ func TestCatalog_DeleteVolumeTombstonesAndReleases(t *testing.T) { t.Fatalf("delete w3 with a failing claim removal: %+v %v; want an error, claim not released, uncertain", res, err) } f.failUpdate = nil - res, err = c.DeleteVolume(ctx, "w3", nil) - if err != nil || !res.ClaimReleased || !res.Completed { + rsv := &fakeReservation{} + res, err = c.DeleteVolume(ctx, "w3", rsv.admission("d3")) + if err != nil || !res.ClaimReleased || !res.Completed || !res.Committed || rsv.state != reservationCommitted { t.Fatalf("delete w3 rerun: %+v %v; want its claim released", res, err) } if got := claimsOf(t, c, "s2"); len(got) != 0 { @@ -371,6 +377,202 @@ func TestCatalog_DeleteVolumeTombstonesAndReleases(t *testing.T) { } } +// fakeReservation mirrors the blockmaster's deletion reservation (tokens, +// admitted/committed) for the catalog's Admission. +type fakeReservation struct { + mu sync.Mutex + state string + holders map[string]bool + refuse bool // Admit refuses (nothing recorded) + loseAdmit bool // Admit records, then its response is lost +} + +const ( + reservationAdmitted = "admitted" + reservationCommitted = "committed" +) + +type fakeAdmit struct { + r *fakeReservation + tok string +} + +func (r *fakeReservation) admission(tok string) Admission { return &fakeAdmit{r, tok} } + +func (a *fakeAdmit) Admit(context.Context, string) error { + a.r.mu.Lock() + defer a.r.mu.Unlock() + if a.r.refuse { + return fmt.Errorf("%w: assigned to r1", ErrNotAdmitted) + } + if a.r.holders == nil { + a.r.holders = map[string]bool{} + } + a.r.holders[a.tok] = true + if a.r.state == "" { + a.r.state = reservationAdmitted + } + if a.r.loseAdmit { + return errors.New("response lost") + } + return nil +} + +func (a *fakeAdmit) Commit(context.Context, string) error { + a.r.mu.Lock() + defer a.r.mu.Unlock() + if a.r.state != reservationCommitted && !a.r.holders[a.tok] { + return errors.New("token holds nothing") + } + a.r.state = reservationCommitted + return nil +} + +func (a *fakeAdmit) Abort(context.Context, string) error { + a.r.mu.Lock() + defer a.r.mu.Unlock() + if a.r.state == reservationCommitted { + return errors.New("committed") + } + delete(a.r.holders, a.tok) + if len(a.r.holders) == 0 { + a.r.state = "" + } + return nil +} + +// A held HEAD found after the admission gives the admission back. +func TestCatalog_DeleteVolumeHeldAfterAdmissionGivesBack(t *testing.T) { + _, _, c, _ := deleteFixture(t) // v1 is attached + rsv := &fakeReservation{} + res, err := c.DeleteVolume(context.Background(), "v1", rsv.admission("d1")) + if CodeOf(err) != CodeVolumeInUse || !res.Admitted || !res.AdmissionAborted || rsv.state != "" { + t.Fatalf("held after admission: %+v %v reservation=%q; want volume_in_use and the admission given back", res, err, rsv.state) + } +} + +// A lost admission response is reported as an unknown outcome (it may be +// recorded), never as a plain refusal, and nothing is written. +func TestCatalog_DeleteVolumeLostAdmissionResponse(t *testing.T) { + f, b, c, _ := deleteFixture(t) + detachHead(t, f, b, "v1") + before := len(f.allWritten()) + rsv := &fakeReservation{loseAdmit: true} + res, err := c.DeleteVolume(context.Background(), "v1", rsv.admission("d1")) + var ce *CatalogError + if !errors.As(err, &ce) || ce.Code != CodeOutcomeUnknown || !ce.Retryable || !res.AdmissionUncertain || !res.Uncertain || res.Admitted { + t.Fatalf("lost admission response: %+v %v; want outcome_unknown, admission uncertain", res, err) + } + if got := len(f.allWritten()); got != before || rsv.state != reservationAdmitted { + t.Fatalf("wrote %d entries; reservation %q (the lost admission did land)", got-before, rsv.state) + } +} + +// P2 (concurrent deletes): D1 samples a live claim and pauses before its +// revert; the fork completes, D2 joins the deleting HEAD, finds no claim, +// commits and deletes. D1's revert then finds the HEAD past the commit +// point: it neither reverts nor gives its admission back, and the +// reservation stays committed. +func TestCatalog_ConcurrentDeleteCannotRollBackACommittedOne(t *testing.T) { + f, b, c, _ := deleteFixture(t) + ctx := context.Background() + detachHead(t, f, b, "v1") + holdFirst(f, catBase+"/w3/HEAD") + if _, err := c.Fork(ctx, ForkRequest{Source: "v1", Snapshot: "s2", Target: "w3", RequestID: "f3"}); CodeOf(err) != CodeOutcomeUnknown { + t.Fatalf("fork w3: %v", err) + } + rsv := &fakeReservation{} + var d2 VolumeDeleteResult + var d2err error + c.retainHook = func(stage, _ string) { + if stage != hookClaimFound { + return + } + c.retainHook = nil + // The fork completes (its claim is no longer live), then D2 runs. + if _, err := c.Fork(ctx, ForkRequest{Source: "v1", Snapshot: "s2", Target: "w3", RequestID: "f3"}); CodeOf(err) != CodeVolumeDeleted { + // Its retry sees the deleting source and backs out; give the + // target a real HEAD as a completed fork would have. + t.Logf("fork retry during the delete: %v", err) + } + forceHead(t, f, b, "w3") + d2, d2err = c.DeleteVolume(ctx, "v1", rsv.admission("d2")) + } + d1, err := c.DeleteVolume(ctx, "v1", rsv.admission("d1")) + if d2err != nil || !d2.Completed { + t.Fatalf("D2: %+v %v; want completed", d2, d2err) + } + if err == nil || d1.Reverted || d1.AdmissionAborted { + t.Fatalf("D1 after D2 committed: %+v %v; want an error, no revert, no give-back", d1, err) + } + if h := headState(t, c, "v1"); h.State != storage.ChunkHeadDeleted { + t.Fatalf("HEAD after both: %+v; want deleted", h) + } + if rsv.state != reservationCommitted { + t.Fatalf("reservation %q; want committed", rsv.state) + } +} + +// forceHead installs a real active HEAD for vol (a completed fork's). +func forceHead(t *testing.T, f *fakeFiler, b *fakeBlobs, vol string) { + t.Helper() + f.mu.Lock() + defer f.mu.Unlock() + e, err := headEntry(storage.ChunkHead{Gen: 1, Chunks: map[uint64]storage.ChunkRef{}, State: storage.ChunkHeadActive}) + if err != nil { + t.Fatal(err) + } + f.entries[path.Join(catBase, vol, headName)] = e + _ = b +} + +// P2 (failed abort, late publication): snapshot A takes name s5 and parks +// before publishing; the delete marks HEAD; A's same-request retry B sees +// the mark and tries to abort the attempt, but the tombstone write fails: +// the name must stay (not freed), so the delete still finds and settles it +// and the late publication cannot leave an active root. +func TestCatalog_FailedAbortCannotHideALatePublication(t *testing.T) { + f, b, c, h := deleteFixture(t) + ctx := context.Background() + detachHead(t, f, b, "v1") + held := catBase + "/v1/" + snapsDir + "/s5/" + f.deferCreate = func(p string, _ *filerpb.Entry) bool { return strings.HasPrefix(p, held) } + if _, err := c.CreateSnapshot(ctx, "v1", SnapshotRequest{Name: "s5", RequestID: "r-s5"}, h); err == nil { + t.Fatal("A's held publication reported success") + } + f.deferCreate = nil + c.retainHook = func(stage, _ string) { + if stage != hookHeadMarked { + return + } + c.retainHook = nil + f.failCreate = func(p string) error { + if strings.HasPrefix(p, held) { + return errors.New("filer unavailable") + } + return nil + } + if _, err := c.CreateSnapshot(ctx, "v1", SnapshotRequest{Name: "s5", RequestID: "r-s5"}, h); CodeOf(err) != CodeVolumeDeleted { + t.Fatalf("B, the same request after the mark: %v; want volume_deleted", err) + } + f.failCreate = nil + if _, ok, _ := c.resolveSnap(ctx, "v1", "s5"); !ok { + t.Fatal("B freed s5's name although its abort failed") + } + } + res, err := c.DeleteVolume(ctx, "v1", nil) + if err != nil || !res.Completed { + t.Fatalf("delete: %+v %v", res, err) + } + f.releaseDeferredCreates() // A's publish finally runs + attempts, _ := f.ListEntries(ctx, held[:len(held)-1], "", "", 0) + for _, e := range attempts { + if s := string(e.Extended[extSnapState]); s == SnapActive { + t.Fatalf("an active s5 attempt %s survived the completed delete", e.GetName()) + } + } +} + func mustHead(t *testing.T, c *Catalog, vol string) storage.ChunkHead { t.Helper() h, has, err := c.ReadHead(context.Background(), vol) diff --git a/seaweed-block/core/host/master/host.go b/seaweed-block/core/host/master/host.go index a829f0a713..077d3bd3c9 100644 --- a/seaweed-block/core/host/master/host.go +++ b/seaweed-block/core/host/master/host.go @@ -89,6 +89,8 @@ type LifecycleStores struct { Nodes *lifecycle.NodeInventoryStore Placements *lifecycle.PlacementIntentStore WorkspaceBindings *lifecycle.WorkspaceBindingStore + // Deletions holds the chunk-volume deletion reservations. + Deletions *lifecycle.DeletionReservationStore } // Host is the composed master-side block product daemon. Lifecycle @@ -311,11 +313,16 @@ func openLifecycleStores(dir string) (*LifecycleStores, error) { if err != nil { return nil, err } + deletions, err := lifecycle.OpenDeletionReservationStore(filepath.Join(dir, "deletion-reservations")) + if err != nil { + return nil, err + } return &LifecycleStores{ Volumes: volumes, Nodes: nodes, Placements: placements, WorkspaceBindings: bindings, + Deletions: deletions, }, nil } diff --git a/seaweed-block/core/host/master/launcher_plan.go b/seaweed-block/core/host/master/launcher_plan.go index 7c6671f175..901fe070b5 100644 --- a/seaweed-block/core/host/master/launcher_plan.go +++ b/seaweed-block/core/host/master/launcher_plan.go @@ -42,7 +42,7 @@ func (h *Host) RunLifecycleWorkloadPlanTick(cfg lifecycle.WorkloadPlanConfig) (L var pending []pendingPlan for _, placement := range stores.Placements.ListPlacements() { volume, ok := volumeByID[placement.VolumeID] - if !ok || volume.Deleting { + if !ok || stores.Deletions.Reserved(placement.VolumeID) { result.SkippedMissingVolume++ continue } diff --git a/seaweed-block/core/host/master/product_loop.go b/seaweed-block/core/host/master/product_loop.go index 4b9bc82cfd..ae62d1aa6d 100644 --- a/seaweed-block/core/host/master/product_loop.go +++ b/seaweed-block/core/host/master/product_loop.go @@ -58,7 +58,7 @@ func (h *Host) RunLifecycleProductTick() (LifecycleProductTickResult, error) { return LifecycleProductTickResult{}, nil } nodes := stores.Nodes.ListNodes() - reconciled := lifecycle.ReconcilePlacement(stores.Volumes.ListVolumes(), nodes, stores.Placements) + reconciled := lifecycle.ReconcilePlacement(stores.liveVolumes(), nodes, stores.Placements) placements := stores.Placements.ListPlacements() verified := h.verifyPlacements(placements, nodes) result := LifecycleProductTickResult{ diff --git a/seaweed-block/core/host/master/services.go b/seaweed-block/core/host/master/services.go index f4f257d1fa..f6f4787896 100644 --- a/seaweed-block/core/host/master/services.go +++ b/seaweed-block/core/host/master/services.go @@ -56,6 +56,15 @@ func (s *services) CreateVolume(ctx context.Context, req *control.CreateVolumeRe return nil, status.Error(codes.FailedPrecondition, "lifecycle store is not configured") } spec := lifecycleSpecFromWire(req) + // A reserved id (a chunk volume delete admitted or committed) is never + // created again; the reservation is checked under the lock its writer + // holds. + s.host.workspaceMu.Lock() + reserved := stores.Deletions.Reserved(spec.VolumeID) && false // RED: the reservation does not stop CreateVolume + s.host.workspaceMu.Unlock() + if reserved { + return nil, status.Errorf(codes.FailedPrecondition, "create volume: %s is being deleted or was deleted; its id is never reused", spec.VolumeID) + } s.host.log.Printf("blockmaster: CreateVolume volume=%q protocol=%q replication_factor=%d pvc=%q namespace=%q", spec.VolumeID, spec.Protocol, spec.ReplicationFactor, spec.PVCName, spec.PVCNamespace) rec, err := stores.Volumes.CreateVolume(spec) if err != nil { @@ -135,17 +144,78 @@ func (s *services) MarkVolumeDeleting(ctx context.Context, req *control.MarkVolu return nil, lifecycleError("mark volume deleting", err) } _, placed := stores.Placements.GetPlacement(vol) - known := false + var res lifecycle.DeletionReservation + var persistErr error err = s.host.Publisher().RecordWorkspaceDeletion(ctx, vol, bound && placed, func() error { - found, e := stores.Volumes.MarkDeleting(vol) - known = found - return e + res, persistErr = stores.Deletions.Admit(vol, req.GetToken()) + return persistErr }) - if err != nil { + switch { + case persistErr != nil: + // The admission check passed; the reservation write failed or its + // outcome is unknown (the store keeps it in memory, fail closed). + return nil, status.Errorf(codes.Unavailable, "mark volume deleting: %v", persistErr) + case err != nil: return nil, status.Errorf(codes.FailedPrecondition, "mark volume deleting: %v", err) } - s.host.log.Printf("blockmaster: MarkVolumeDeleting volume=%q known=%t", vol, known) - return &control.MarkVolumeDeletingResponse{Known: known}, nil + _, known := stores.Volumes.GetVolume(vol) + s.host.log.Printf("blockmaster: MarkVolumeDeleting volume=%q known=%t state=%s", vol, known, res.State) + return &control.MarkVolumeDeletingResponse{Known: known, State: res.State}, nil +} + +// AbortVolumeDeleting gives a delete's admission back (the delete found it +// could not proceed and undid its own effects). A committed deletion is +// never given back (FAILED_PRECONDITION). +func (s *services) AbortVolumeDeleting(ctx context.Context, req *control.MarkVolumeDeletingRequest) (*control.MarkVolumeDeletingResponse, error) { + return s.settleVolumeDeleting(ctx, req, "abort", (*lifecycle.DeletionReservationStore).Abort) +} + +// CommitVolumeDeleting makes a delete's reservation permanent: the delete +// is about to take irreversible steps. +func (s *services) CommitVolumeDeleting(ctx context.Context, req *control.MarkVolumeDeletingRequest) (*control.MarkVolumeDeletingResponse, error) { + return s.settleVolumeDeleting(ctx, req, "commit", (*lifecycle.DeletionReservationStore).Commit) +} + +func (s *services) settleVolumeDeleting(ctx context.Context, req *control.MarkVolumeDeletingRequest, op string, + apply func(*lifecycle.DeletionReservationStore, string, string) (lifecycle.DeletionReservation, error)) (*control.MarkVolumeDeletingResponse, error) { + s.host.workspaceMu.Lock() + defer s.host.workspaceMu.Unlock() + if err := ctx.Err(); err != nil { + return nil, workspaceError(err) + } + stores := s.host.Lifecycle() + if stores == nil { + return nil, status.Error(codes.FailedPrecondition, "lifecycle store is not configured") + } + if req.GetVolumeId() == "" || req.GetToken() == "" { + return nil, status.Error(codes.InvalidArgument, "volume_id and token are required") + } + res, err := apply(stores.Deletions, req.GetVolumeId(), req.GetToken()) + switch { + case errors.Is(err, lifecycle.ErrReservationCommitted), errors.Is(err, lifecycle.ErrReservationToken): + return nil, status.Errorf(codes.FailedPrecondition, "%s volume deleting: %v", op, err) + case err != nil: + return nil, status.Errorf(codes.Unavailable, "%s volume deleting: %v", op, err) + } + s.host.log.Printf("blockmaster: %s VolumeDeleting volume=%q state=%s", op, req.GetVolumeId(), res.State) + state := res.State + if state == lifecycle.ReservationAdmitted && len(res.Tokens) == 0 { + state = "" + } + return &control.MarkVolumeDeletingResponse{State: state}, nil +} + +// liveVolumes is the desired volumes the placement reconciler may plan: +// every record whose id no delete has reserved. +func (st *LifecycleStores) liveVolumes() []lifecycle.VolumeRecord { + all := st.Volumes.ListVolumes() + out := all[:0:0] + for _, v := range all { + if !st.Deletions.Reserved(v.Spec.VolumeID) { + out = append(out, v) + } + } + return out } func (s *services) ExecuteFailback(ctx context.Context, req *control.FailbackRequest) (*control.FailbackResponse, error) { @@ -221,9 +291,7 @@ func lifecycleError(op string, err error) error { if errors.Is(err, lifecycle.ErrVolumeConflict) { return status.Errorf(codes.AlreadyExists, "%s: %v", op, err) } - if errors.Is(err, lifecycle.ErrVolumeDeleting) { - return status.Errorf(codes.FailedPrecondition, "%s: %v", op, err) - } + return status.Errorf(codes.Internal, "%s: %v", op, err) } diff --git a/seaweed-block/core/host/master/volume_deleting_test.go b/seaweed-block/core/host/master/volume_deleting_test.go index 1775da86b4..b58f3d427a 100644 --- a/seaweed-block/core/host/master/volume_deleting_test.go +++ b/seaweed-block/core/host/master/volume_deleting_test.go @@ -1,37 +1,124 @@ package master import ( + "context" "testing" "time" + "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/status" "github.com/seaweedfs/seaweed-block/core/lifecycle" control "github.com/seaweedfs/seaweed-block/core/rpc/control" ) -// MarkVolumeDeleting is the master-side admission of a chunk volume delete -// (codex01's review of #152, P1 3): refused while the volume has live -// authority; once marked, a placement that already exists no longer leads -// to an assignment, and the id is never created, placed or bound again. +// The master's deletion reservation (review of #152 r2): durable, separate +// from the desired-volume record, held by token, given back by Abort, +// permanent after Commit. + +func markReq(vol, tok string) *control.MarkVolumeDeletingRequest { + return &control.MarkVolumeDeletingRequest{VolumeId: vol, Token: tok} +} + +func createReq(vol string) *control.CreateVolumeRequest { + return &control.CreateVolumeRequest{VolumeId: vol, SizeBytes: 1 << 20, ReplicationFactor: 1} +} + +// hostOn starts a master on fixed store directories (so a test can restart +// it) and returns it with a lifecycle client. +func hostOn(t *testing.T, authDir, lcDir string) (*Host, control.LifecycleServiceClient, func()) { + t.Helper() + h, err := New(Config{Listen: "127.0.0.1:0", AuthorityStoreDir: authDir, LifecycleStoreDir: lcDir}) + if err != nil { + t.Fatal(err) + } + h.Start() + c, err := grpc.NewClient(h.Addr(), grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + t.Fatal(err) + } + stop := func() { + c.Close() + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + _ = h.Close(ctx) + } + return h, control.NewLifecycleServiceClient(c), stop +} func TestMarkVolumeDeleting_RefusedWhileAssigned(t *testing.T) { h, c, ctx := reviewBindingHost(t) reviewLegacyBind(t, h, c, ctx, "live") - _, err := control.NewLifecycleServiceClient(c).MarkVolumeDeleting(ctx, &control.MarkVolumeDeletingRequest{VolumeId: "live"}) + _, err := control.NewLifecycleServiceClient(c).MarkVolumeDeleting(ctx, markReq("live", "d1")) if status.Code(err) != codes.FailedPrecondition { t.Fatalf("mark of an assigned volume: %v; want FailedPrecondition", err) } - if rec, _ := h.Lifecycle().Volumes.GetVolume("live"); rec.Deleting { - t.Fatal("a refused mark marked the record") + if h.Lifecycle().Deletions.Reserved("live") { + t.Fatal("a refused mark reserved the id") } } +// P1: an id the master never knew is reserved too, and the ordinary +// DeleteVolume of a known record does not clear the reservation; both hold +// across a restart. +func TestMarkVolumeDeleting_ReservesUnknownIdsAndSurvivesDeleteAndRestart(t *testing.T) { + authDir, lcDir := t.TempDir(), t.TempDir() + ctx := context.Background() + h, lc, stop := hostOn(t, authDir, lcDir) + if resp, err := lc.MarkVolumeDeleting(ctx, markReq("forkvol", "d1")); err != nil || resp.GetKnown() || resp.GetState() != lifecycle.ReservationAdmitted { + t.Fatalf("mark of an unknown id: %+v %v; want admitted, not known", resp, err) + } + if _, err := lc.CreateVolume(ctx, createReq("known")); err != nil { + t.Fatal(err) + } + if resp, err := lc.MarkVolumeDeleting(ctx, markReq("known", "d2")); err != nil || !resp.GetKnown() { + t.Fatalf("mark of a known volume: %+v %v", resp, err) + } + if _, err := lc.DeleteVolume(ctx, &control.DeleteVolumeRequest{VolumeId: "known"}); err != nil { + t.Fatalf("ordinary delete of the record: %v", err) + } + for _, vol := range []string{"forkvol", "known"} { + if _, err := lc.CreateVolume(ctx, createReq(vol)); status.Code(err) != codes.FailedPrecondition { + t.Fatalf("create of reserved %s: %v; want FailedPrecondition", vol, err) + } + } + _ = h + stop() + h, lc, stop = hostOn(t, authDir, lcDir) + defer stop() + for _, vol := range []string{"forkvol", "known"} { + if !h.Lifecycle().Deletions.Reserved(vol) { + t.Fatalf("%s's reservation lost on restart", vol) + } + if _, err := lc.CreateVolume(ctx, createReq(vol)); status.Code(err) != codes.FailedPrecondition { + t.Fatalf("create of reserved %s after restart: %v; want FailedPrecondition", vol, err) + } + } + // Abort gives the unknown id back (usable again); a committed one never. + if resp, err := lc.AbortVolumeDeleting(ctx, markReq("forkvol", "d1")); err != nil || resp.GetState() != "" { + t.Fatalf("abort: %+v %v; want the reservation gone", resp, err) + } + if _, err := lc.CreateVolume(ctx, createReq("forkvol")); err != nil { + t.Fatalf("create after the abort: %v", err) + } + if _, err := lc.CommitVolumeDeleting(ctx, markReq("known", "d2")); err != nil { + t.Fatal(err) + } + if _, err := lc.AbortVolumeDeleting(ctx, markReq("known", "d2")); status.Code(err) != codes.FailedPrecondition { + t.Fatalf("abort of a committed deletion: %v; want FailedPrecondition", err) + } + if _, err := lc.CommitVolumeDeleting(ctx, markReq("nothing", "dx")); status.Code(err) != codes.FailedPrecondition { + t.Fatalf("commit of an unreserved id: %v; want FailedPrecondition", err) + } +} + +// P1: a reserved volume with an existing placement gets no assignment, and +// the reserved id is not placed, created or bound. func TestMarkVolumeDeleting_StopsLaterAssignmentPlacementAndBinding(t *testing.T) { h, c, ctx := reviewBindingHost(t) lc := control.NewLifecycleServiceClient(c) - // "placed" has a placement already (no authority yet); "fresh" has none. for _, vol := range []string{"placed", "fresh"} { reviewCreate(t, c, ctx, vol) } @@ -39,16 +126,10 @@ func TestMarkVolumeDeleting_StopsLaterAssignmentPlacementAndBinding(t *testing.T t.Fatal(e) } for _, vol := range []string{"placed", "fresh"} { - resp, err := lc.MarkVolumeDeleting(ctx, &control.MarkVolumeDeletingRequest{VolumeId: vol}) - if err != nil || !resp.GetKnown() { - t.Fatalf("mark %s: %+v %v", vol, resp, err) - } - if rec, _ := h.Lifecycle().Volumes.GetVolume(vol); !rec.Deleting { - t.Fatalf("%s not marked", vol) + if _, err := lc.MarkVolumeDeleting(ctx, markReq(vol, "d-"+vol)); err != nil { + t.Fatalf("mark %s: %v", vol, err) } } - // The placed volume's replica reports in; the product tick would bind - // it. Neither volume may get authority, and "fresh" no placement. reviewHeartbeat(t, c, ctx, "placed", "node-a", "127.0.0.1:10000", "127.0.0.1:10001") reviewHeartbeat(t, c, ctx, "fresh", "node-a", "127.0.0.1:10002", "127.0.0.1:10003") for i := 0; i < 3; i++ { @@ -63,17 +144,9 @@ func TestMarkVolumeDeleting_StopsLaterAssignmentPlacementAndBinding(t *testing.T } } if _, ok := h.Lifecycle().Placements.GetPlacement("fresh"); ok { - t.Fatal("the reconciler placed a volume marked deleting") - } - // Never created, bound or placed again. - if _, err := lc.CreateVolume(ctx, &control.CreateVolumeRequest{VolumeId: "fresh", SizeBytes: 1 << 20, ReplicationFactor: 1}); status.Code(err) != codes.FailedPrecondition { - t.Fatalf("re-create of a deleting volume: %v; want FailedPrecondition", err) + t.Fatal("the reconciler placed a reserved volume") } if _, err := control.NewWorkspaceServiceClient(c).RegisterWorkspaceBinding(ctx, &control.WorkspaceBinding{VolumeId: "fresh", ServerId: "node-b", DataAddr: "127.0.0.1:9200", CtrlAddr: "127.0.0.1:9100"}); status.Code(err) != codes.FailedPrecondition { - t.Fatalf("binding of a deleting volume: %v; want FailedPrecondition", err) - } - // A volume the master never knew is admitted after the authority check. - if resp, err := lc.MarkVolumeDeleting(ctx, &control.MarkVolumeDeletingRequest{VolumeId: "unknown"}); err != nil || resp.GetKnown() { - t.Fatalf("mark of an unknown volume: %+v %v; want admitted, not known", resp, err) + t.Fatalf("binding of a reserved volume: %v; want FailedPrecondition", err) } } diff --git a/seaweed-block/core/host/master/workspace_binding.go b/seaweed-block/core/host/master/workspace_binding.go index 2d52eb63f4..854adb49ad 100644 --- a/seaweed-block/core/host/master/workspace_binding.go +++ b/seaweed-block/core/host/master/workspace_binding.go @@ -160,11 +160,12 @@ func (h *Host) admitWorkspacePublication(ask authority.AssignmentAsk, publish fu } h.workspaceMu.Lock() defer h.workspaceMu.Unlock() - if rec, alive := h.lifecycle.Volumes.GetVolume(ask.VolumeID); !alive { - return fmt.Errorf("workspace publication: volume no longer exists") - } else if rec.Deleting { + if h.lifecycle.Deletions.Reserved(ask.VolumeID) { return fmt.Errorf("workspace publication: volume is being deleted") } + if _, alive := h.lifecycle.Volumes.GetVolume(ask.VolumeID); !alive { + return fmt.Errorf("workspace publication: volume no longer exists") + } bindings, bound, err := h.lifecycle.WorkspaceBindings.Get(ask.VolumeID) if err != nil { return err diff --git a/seaweed-block/core/host/master/workspace_service.go b/seaweed-block/core/host/master/workspace_service.go index 7af3bfe144..f1e17f69a3 100644 --- a/seaweed-block/core/host/master/workspace_service.go +++ b/seaweed-block/core/host/master/workspace_service.go @@ -22,7 +22,7 @@ func (s *services) workspaceVolume(volume string) error { if !ok || r.Spec.ReplicationFactor != 1 { return status.Error(codes.FailedPrecondition, "workspace move requires an existing RF1 volume") } - if r.Deleting { + if s.host.lifecycle.Deletions.Reserved(volume) { return status.Error(codes.FailedPrecondition, "workspace: volume is being deleted") } return nil diff --git a/seaweed-block/core/lifecycle/deletion_reservations.go b/seaweed-block/core/lifecycle/deletion_reservations.go new file mode 100644 index 0000000000..f1f0b462d8 --- /dev/null +++ b/seaweed-block/core/lifecycle/deletion_reservations.go @@ -0,0 +1,249 @@ +package lifecycle + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "path/filepath" + "sort" + "sync" +) + +// Deletion reservations (review of #152 r2): the master-side exclusion of a +// chunk volume id that a delete has admitted. It is kept apart from the +// desired-volume records, so neither an unknown id (no VolumeRecord) nor the +// ordinary DeleteVolume/CreateVolume path can drop it. +// +// - admitted: one or more deletes hold it (by token). An admitted delete +// that gives back without irreversible effects aborts its token; the +// reservation goes when no token is left. +// - committed: a delete passed its irreversible boundary. Permanent: the +// id is never created, placed, bound or assigned again. +// +// Writes are crash-safe and durable (synced temp file, atomic rename, synced +// directory). A write whose outcome is unknown fails closed: the store keeps +// the more protective state in memory and reports the error. + +const ( + ReservationAdmitted = "admitted" + ReservationCommitted = "committed" + + reservationsFile = "reservations.json" +) + +var ( + // ErrReservationCommitted refuses giving back a committed deletion. + ErrReservationCommitted = errors.New("lifecycle: volume deletion is committed") + // ErrReservationToken refuses an empty or unknown delete token. + ErrReservationToken = errors.New("lifecycle: deletion token required") +) + +// DeletionReservation is one volume's deletion exclusion. +type DeletionReservation struct { + VolumeID string `json:"volume_id"` + State string `json:"state"` + Tokens []string `json:"tokens,omitempty"` +} + +// DeletionReservationStore persists the reservations as one JSON document. +type DeletionReservationStore struct { + mu sync.Mutex + dir string + records map[string]DeletionReservation + + // Test seams for persistence faults (nil in production). + failWrite, failRename, failDirSync func() error +} + +// OpenDeletionReservationStore opens or creates the store in dir. +func OpenDeletionReservationStore(dir string) (*DeletionReservationStore, error) { + if dir == "" { + return nil, fmt.Errorf("%w: empty dir", ErrInvalidVolumeSpec) + } + if err := os.MkdirAll(dir, 0o755); err != nil { + return nil, fmt.Errorf("lifecycle: mkdir %q: %w", dir, err) + } + s := &DeletionReservationStore{dir: dir, records: map[string]DeletionReservation{}} + b, err := os.ReadFile(filepath.Join(dir, reservationsFile)) + switch { + case errors.Is(err, os.ErrNotExist): + return s, nil + case err != nil: + return nil, fmt.Errorf("lifecycle: read deletion reservations: %w", err) + } + if err := json.Unmarshal(b, &s.records); err != nil { + return nil, fmt.Errorf("lifecycle: decode deletion reservations: %w", err) + } + for v, r := range s.records { + if r.VolumeID != v || (r.State != ReservationAdmitted && r.State != ReservationCommitted) { + return nil, fmt.Errorf("lifecycle: deletion reservation %q is invalid", v) + } + } + return s, nil +} + +// Get returns vol's reservation. +func (s *DeletionReservationStore) Get(vol string) (DeletionReservation, bool) { + s.mu.Lock() + defer s.mu.Unlock() + r, ok := s.records[vol] + return r, ok +} + +// Reserved reports whether vol is excluded (admitted or committed). +func (s *DeletionReservationStore) Reserved(vol string) bool { + _, ok := s.Get(vol) + return ok +} + +// Admit adds token's hold on vol (idempotent; a committed reservation stays +// committed). +func (s *DeletionReservationStore) Admit(vol, token string) (DeletionReservation, error) { + if err := validateVolumeID(vol); err != nil { + return DeletionReservation{}, err + } + if token == "" { + return DeletionReservation{}, ErrReservationToken + } + return s.update(vol, true, func(r *DeletionReservation, ok bool) (bool, error) { + if !ok { + *r = DeletionReservation{VolumeID: vol, State: ReservationAdmitted} + } + if !containsToken(r.Tokens, token) { + r.Tokens = append(r.Tokens, token) + sort.Strings(r.Tokens) + } + return true, nil + }) +} + +// Commit makes vol's reservation permanent; token must hold it. +func (s *DeletionReservationStore) Commit(vol, token string) (DeletionReservation, error) { + return s.update(vol, true, func(r *DeletionReservation, ok bool) (bool, error) { + if !ok || (r.State != ReservationCommitted && !containsToken(r.Tokens, token)) { + return false, ErrReservationToken + } + r.State = ReservationCommitted + return true, nil + }) +} + +// Abort gives back token's hold; the reservation goes with its last token. +// A committed reservation is never given back. +func (s *DeletionReservationStore) Abort(vol, token string) (DeletionReservation, error) { + return s.update(vol, false, func(r *DeletionReservation, ok bool) (bool, error) { + if !ok { + return false, nil // nothing held: already given back + } + if r.State == ReservationCommitted { + return false, ErrReservationCommitted + } + kept := r.Tokens[:0:0] + for _, t := range r.Tokens { + if t != token { + kept = append(kept, t) + } + } + r.Tokens = kept + return true, nil + }) +} + +func containsToken(tokens []string, t string) bool { + for _, x := range tokens { + if x == t { + return true + } + } + return false +} + +// update applies change to vol's reservation and persists it. protective +// says whether the change only adds exclusion: on a write whose outcome is +// unknown (rename or directory sync failed) a protective change is kept in +// memory (fail closed), a releasing one is not. +func (s *DeletionReservationStore) update(vol string, protective bool, change func(r *DeletionReservation, ok bool) (bool, error)) (DeletionReservation, error) { + s.mu.Lock() + defer s.mu.Unlock() + r, ok := s.records[vol] + r.Tokens = append([]string(nil), r.Tokens...) + changed, err := change(&r, ok) + if err != nil || !changed { + return r, err + } + next := make(map[string]DeletionReservation, len(s.records)+1) + for k, v := range s.records { + next[k] = v + } + if r.State == ReservationAdmitted && len(r.Tokens) == 0 { + delete(next, vol) + } else { + next[vol] = r + } + if err := s.persist(next, protective); err != nil { + return r, err + } + s.records = next + return r, nil +} + +func (s *DeletionReservationStore) persist(next map[string]DeletionReservation, protective bool) error { + if red := true; red { // RED: intent-only, nothing written or synced + return nil + } + b, err := json.Marshal(next) + if err != nil { + return err + } + f, err := os.CreateTemp(s.dir, "reservations-*.tmp") + if err != nil { + return fmt.Errorf("lifecycle: deletion reservation write: %w", err) + } + defer os.Remove(f.Name()) + if s.failWrite != nil { + err = s.failWrite() + } + if err == nil { + _, err = f.Write(b) + } + if err == nil { + err = f.Sync() + } + if cerr := f.Close(); err == nil { + err = cerr + } + if err != nil { + return fmt.Errorf("lifecycle: deletion reservation write: %w", err) // nothing replaced + } + unknown := func(err error) error { + if protective { + s.records = next // may be on disk: keep the exclusion + } + return fmt.Errorf("lifecycle: deletion reservation outcome unknown: %w", err) + } + if s.failRename != nil { + if err := s.failRename(); err != nil { + return unknown(err) + } + } + if err := os.Rename(f.Name(), filepath.Join(s.dir, reservationsFile)); err != nil { + return unknown(err) + } + if s.failDirSync != nil { + if err := s.failDirSync(); err != nil { + return unknown(err) + } + } + d, err := os.Open(s.dir) + if err == nil { + err = d.Sync() + if cerr := d.Close(); err == nil { + err = cerr + } + } + if err != nil { + return unknown(err) + } + return nil +} diff --git a/seaweed-block/core/lifecycle/deletion_reservations_test.go b/seaweed-block/core/lifecycle/deletion_reservations_test.go new file mode 100644 index 0000000000..280e4c0237 --- /dev/null +++ b/seaweed-block/core/lifecycle/deletion_reservations_test.go @@ -0,0 +1,98 @@ +package lifecycle + +import ( + "errors" + "testing" +) + +func reopen(t *testing.T, dir string) *DeletionReservationStore { + t.Helper() + s, err := OpenDeletionReservationStore(dir) + if err != nil { + t.Fatal(err) + } + return s +} + +// Admit holds by token, Abort gives a token back (the reservation goes with +// the last), Commit is permanent; every state survives a reopen. +func TestDeletionReservations_AdmitAbortCommitSurviveRestart(t *testing.T) { + dir := t.TempDir() + s := reopen(t, dir) + if _, err := s.Admit("v1", ""); !errors.Is(err, ErrReservationToken) { + t.Fatalf("admit without a token: %v", err) + } + for _, tok := range []string{"d1", "d2"} { + if _, err := s.Admit("v1", tok); err != nil { + t.Fatal(err) + } + } + if _, err := s.Abort("v1", "d1"); err != nil || !reopen(t, dir).Reserved("v1") { + t.Fatalf("abort of one of two tokens: %v; want still reserved after restart", err) + } + if _, err := s.Abort("v1", "d2"); err != nil || s.Reserved("v1") || reopen(t, dir).Reserved("v1") { + t.Fatalf("abort of the last token: %v; want the reservation gone (also after restart)", err) + } + if _, err := s.Admit("v2", "d3"); err != nil { + t.Fatal(err) + } + if _, err := s.Commit("v2", "other"); !errors.Is(err, ErrReservationToken) { + t.Fatalf("commit by a token that holds nothing: %v", err) + } + if _, err := s.Commit("v2", "d3"); err != nil { + t.Fatal(err) + } + r := reopen(t, dir) + if got, ok := r.Get("v2"); !ok || got.State != ReservationCommitted { + t.Fatalf("committed reservation after restart: %+v %t", got, ok) + } + if _, err := r.Abort("v2", "d3"); !errors.Is(err, ErrReservationCommitted) || !r.Reserved("v2") { + t.Fatalf("abort of a committed deletion: %v; want refused, still reserved", err) + } + if _, err := r.Admit("v2", "d4"); err != nil { + t.Fatalf("a rerun's admission of a committed deletion: %v", err) + } + if got, _ := r.Get("v2"); got.State != ReservationCommitted { + t.Fatalf("admit downgraded a committed reservation: %+v", got) + } +} + +// Persistence faults fail closed: a failed write before the rename leaves +// nothing (and returns the error); an unknown outcome (rename or directory +// sync failed) keeps a protective change in memory and never a releasing +// one. +func TestDeletionReservations_PersistenceFaultsFailClosed(t *testing.T) { + fail := errors.New("injected") + dir := t.TempDir() + s := reopen(t, dir) + + s.failWrite = func() error { return fail } + if _, err := s.Admit("w", "d1"); !errors.Is(err, fail) || s.Reserved("w") || reopen(t, dir).Reserved("w") { + t.Fatalf("admit with a failing write: %v; want an error and no reservation", err) + } + s.failWrite = nil + + s.failRename = func() error { return fail } + if _, err := s.Admit("r", "d1"); !errors.Is(err, fail) || !s.Reserved("r") { + t.Fatalf("admit with a failing rename: %v; want an error and the reservation kept in memory", err) + } + s.failRename = nil + + s.failDirSync = func() error { return fail } + if _, err := s.Admit("y", "d1"); !errors.Is(err, fail) || !s.Reserved("y") { + t.Fatalf("admit with a failing directory sync: %v; want an error and the reservation kept", err) + } + s.failDirSync = nil + + if _, err := s.Admit("a", "d1"); err != nil { + t.Fatal(err) + } + s.failRename = func() error { return fail } + if _, err := s.Abort("a", "d1"); !errors.Is(err, fail) || !s.Reserved("a") { + t.Fatalf("abort with a failing rename: %v; want an error and the reservation kept", err) + } + s.failRename = nil + if !reopen(t, dir).Reserved("a") { + t.Fatal("a successfully written reservation is lost on restart") + } +} diff --git a/seaweed-block/core/lifecycle/reconciler.go b/seaweed-block/core/lifecycle/reconciler.go index e22b02bed5..c16765ec2d 100644 --- a/seaweed-block/core/lifecycle/reconciler.go +++ b/seaweed-block/core/lifecycle/reconciler.go @@ -17,9 +17,6 @@ func ReconcilePlacement(volumes []VolumeRecord, nodes []NodeRegistration, placem nodes = append([]NodeRegistration(nil), nodes...) results := make([]ReconcileResult, 0, len(volumes)) for _, volume := range volumes { - if volume.Deleting { - continue // never placed again - } plan := PlanPlacement(volume, nodes) result := ReconcileResult{ VolumeID: volume.Spec.VolumeID, diff --git a/seaweed-block/core/lifecycle/store.go b/seaweed-block/core/lifecycle/store.go index b306a7b5a5..1de3e090e2 100644 --- a/seaweed-block/core/lifecycle/store.go +++ b/seaweed-block/core/lifecycle/store.go @@ -23,9 +23,6 @@ var ( ErrVolumeNotFound = errors.New("lifecycle: volume not found") ErrAlreadyAttached = errors.New("lifecycle: volume already attached to another node") ErrAttachedElsewhere = errors.New("lifecycle: volume attached to another node") - // ErrVolumeDeleting: the volume is being deleted (or was); its id is - // never created, placed, bound or assigned again. - ErrVolumeDeleting = errors.New("lifecycle: volume is being deleted") ) var volumeIDPattern = regexp.MustCompile(`^[A-Za-z0-9._-]+$`) @@ -48,8 +45,6 @@ type VolumeSpec struct { type VolumeRecord struct { Spec VolumeSpec `json:"spec"` AttachedTo string `json:"attached_to,omitempty"` - // Deleting is set once by MarkDeleting and never cleared. - Deleting bool `json:"deleting,omitempty"` } // FileStore persists one JSON record per volume ID. @@ -87,9 +82,6 @@ func (s *FileStore) CreateVolume(spec VolumeSpec) (VolumeRecord, error) { s.mu.Lock() defer s.mu.Unlock() if existing, ok := s.records[spec.VolumeID]; ok { - if existing.Deleting { - return VolumeRecord{}, ErrVolumeDeleting - } if !volumeSpecsCompatible(existing.Spec, spec) { return VolumeRecord{}, ErrVolumeConflict } @@ -139,29 +131,6 @@ func mergeVolumeSpecMetadata(existing, incoming VolumeSpec) VolumeSpec { return out } -// MarkDeleting marks volumeID's record deleting (idempotent). found is -// false when there is no record (nothing is written). -func (s *FileStore) MarkDeleting(volumeID string) (found bool, err error) { - if err := validateVolumeID(volumeID); err != nil { - return false, err - } - s.mu.Lock() - defer s.mu.Unlock() - rec, ok := s.records[volumeID] - if !ok { - return false, nil - } - if rec.Deleting { - return true, nil - } - rec.Deleting = true - if err := s.putLocked(rec); err != nil { - return true, err - } - s.records[volumeID] = rec - return true, nil -} - // DeleteVolume removes a desired volume record. Missing volumes are a // successful no-op so delete is safe to retry. func (s *FileStore) DeleteVolume(volumeID string) error { diff --git a/seaweed-block/core/rpc/control/control.pb.go b/seaweed-block/core/rpc/control/control.pb.go index fcd1dc811e..ecaa109beb 100644 --- a/seaweed-block/core/rpc/control/control.pb.go +++ b/seaweed-block/core/rpc/control/control.pb.go @@ -2539,6 +2539,8 @@ type MarkVolumeDeletingRequest struct { unknownFields protoimpl.UnknownFields VolumeId string `protobuf:"bytes,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"` + // token identifies one delete operation (chosen by the caller). + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (x *MarkVolumeDeletingRequest) Reset() { @@ -2580,14 +2582,24 @@ func (x *MarkVolumeDeletingRequest) GetVolumeId() string { return "" } +func (x *MarkVolumeDeletingRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + type MarkVolumeDeletingResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // known is false when the master has no lifecycle record for the volume - // (it then only checked that no authority is live or pending). + // known is true when the master also has a lifecycle record for the + // volume (the reservation applies either way). Known bool `protobuf:"varint,1,opt,name=known,proto3" json:"known,omitempty"` + // state is the reservation after the call: "admitted", "committed" or + // "" (none left). + State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` } func (x *MarkVolumeDeletingResponse) Reset() { @@ -2629,6 +2641,13 @@ func (x *MarkVolumeDeletingResponse) GetKnown() bool { return false } +func (x *MarkVolumeDeletingResponse) GetState() string { + if x != nil { + return x.State + } + return "" +} + type FailbackRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3298,177 +3317,196 @@ var file_control_proto_rawDesc = []byte{ 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x0a, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4e, 0x0a, 0x19, 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x1a, 0x4d, 0x61, 0x72, 0x6b, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x22, 0xa5, 0x04, 0x0a, 0x0f, - 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, - 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, - 0x61, 0x41, 0x64, 0x64, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, - 0x63, 0x74, 0x72, 0x6c, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x74, 0x72, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, - 0x3d, 0x0a, 0x1b, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x49, 0x64, 0x12, 0x34, - 0x0a, 0x16, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, - 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, - 0x70, 0x6f, 0x63, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x6c, 0x69, 0x67, - 0x69, 0x62, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x63, 0x6b, 0x45, - 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x1f, 0x66, 0x72, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x64, 0x5f, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, - 0x65, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1c, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x64, - 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x38, - 0x0a, 0x18, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, - 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, - 0x72, 0x43, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x12, 0x44, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x63, - 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x1b, 0x6e, 0x6f, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, - 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x66, 0x73, 0x22, 0xa7, 0x03, 0x0a, 0x10, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x66, 0x61, 0x69, 0x6c, - 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x41, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x12, 0x41, 0x0a, - 0x1d, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, - 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x41, 0x66, 0x74, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x12, 0x50, 0x0a, 0x25, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x5f, 0x73, 0x77, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, - 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x21, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x77, - 0x61, 0x70, 0x70, 0x65, 0x64, 0x41, 0x66, 0x74, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x12, 0x2e, 0x0a, 0x13, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x11, 0x6e, 0x6f, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x76, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x6e, 0x6f, 0x43, - 0x72, 0x6f, 0x73, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0c, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x66, 0x73, 0x32, 0xdf, 0x01, - 0x0a, 0x12, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, - 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, - 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x72, - 0x74, 0x62, 0x65, 0x61, 0x74, 0x41, 0x63, 0x6b, 0x12, 0x65, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, - 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x28, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, - 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x6b, 0x32, - 0x81, 0x01, 0x0a, 0x11, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x48, 0x0a, + 0x1a, 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6b, + 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6b, 0x6e, 0x6f, 0x77, + 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xa5, 0x04, 0x0a, 0x0f, 0x46, 0x61, 0x69, 0x6c, + 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x41, 0x64, 0x64, + 0x72, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x74, 0x72, 0x6c, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x43, 0x74, 0x72, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x12, 0x3d, 0x0a, 0x1b, 0x65, + 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, + 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x18, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x65, 0x78, 0x70, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x6c, 0x69, 0x67, 0x69, 0x62, 0x6c, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x63, 0x6b, 0x45, 0x6c, 0x69, 0x67, 0x69, + 0x62, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x1f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x5f, + 0x66, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x66, 0x61, + 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x66, 0x72, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x64, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x42, 0x65, 0x66, 0x6f, + 0x72, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x75, + 0x72, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x5f, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x64, 0x75, + 0x72, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, 0x43, 0x6f, 0x76, + 0x65, 0x72, 0x65, 0x64, 0x12, 0x44, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, + 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x6e, + 0x6f, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x76, + 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0c, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x66, 0x73, 0x22, + 0xa7, 0x03, 0x0a, 0x10, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, + 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, + 0x38, 0x0a, 0x18, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x5f, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x41, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x12, 0x41, 0x0a, 0x1d, 0x73, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x61, 0x66, 0x74, 0x65, + 0x72, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x1a, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x41, + 0x66, 0x74, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x50, 0x0a, 0x25, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x73, + 0x77, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x66, 0x61, 0x69, + 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x21, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x77, 0x61, 0x70, 0x70, 0x65, + 0x64, 0x41, 0x66, 0x74, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x2e, + 0x0a, 0x13, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6e, 0x6f, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x44, + 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x76, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x6e, 0x6f, 0x43, 0x72, 0x6f, 0x73, 0x73, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, + 0x5f, 0x72, 0x65, 0x66, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x76, 0x69, + 0x64, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x66, 0x73, 0x32, 0xdf, 0x01, 0x0a, 0x12, 0x4f, 0x62, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x62, 0x0a, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, + 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, - 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x46, 0x61, 0x63, - 0x74, 0x30, 0x01, 0x32, 0x77, 0x0a, 0x0f, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x2e, 0x73, 0x65, - 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd1, 0x04, 0x0a, - 0x16, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x2e, 0x73, 0x65, - 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, - 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x73, - 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x65, 0x61, 0x77, - 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x73, 0x65, 0x61, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x41, 0x63, 0x6b, 0x12, 0x65, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, - 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x76, 0x69, 0x64, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x77, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x31, 0x2e, 0x73, 0x65, 0x61, 0x77, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x1a, 0x28, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x6b, 0x32, 0x81, 0x01, 0x0a, 0x11, + 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x6c, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x41, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, - 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, - 0x12, 0x57, 0x61, 0x74, 0x63, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x57, 0x61, - 0x74, 0x63, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, + 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, + 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x41, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x46, 0x61, 0x63, 0x74, 0x30, 0x01, 0x32, + 0x77, 0x0a, 0x0f, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x64, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, - 0x32, 0xeb, 0x02, 0x0a, 0x10, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x2c, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, + 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xd1, 0x04, 0x0a, 0x16, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, + 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x73, 0x65, 0x61, 0x77, + 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0b, 0x4c, 0x69, 0x73, + 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, + 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, - 0x6d, 0x65, 0x12, 0x2c, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x7d, 0x0a, 0x12, 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, + 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, + 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, + 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x77, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x31, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, + 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, + 0x47, 0x65, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, + 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x12, 0x57, 0x61, 0x74, + 0x63, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x32, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x32, 0xec, 0x04, 0x0a, + 0x10, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x6b, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x12, 0x2c, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2d, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, + 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x2c, + 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, + 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7d, 0x0a, 0x12, 0x4d, + 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, + 0x67, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4d, 0x61, 0x72, 0x6b, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x65, 0x61, 0x77, - 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x79, - 0x0a, 0x0f, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x66, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x46, 0x61, 0x69, 0x6c, - 0x62, 0x61, 0x63, 0x6b, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x46, - 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, - 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, - 0x73, 0x2f, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x3b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7e, 0x0a, 0x13, 0x41, 0x62, + 0x6f, 0x72, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, + 0x67, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4d, 0x61, 0x72, 0x6b, + 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, + 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, + 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x14, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0x32, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4d, 0x61, 0x72, + 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, + 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x79, 0x0a, 0x0f, 0x46, + 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x66, + 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, + 0x6b, 0x12, 0x28, 0x2e, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, + 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x65, + 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x66, 0x73, 0x2f, 0x73, + 0x65, 0x61, 0x77, 0x65, 0x65, 0x64, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x63, 0x6f, 0x72, + 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x3b, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3555,22 +3593,26 @@ var file_control_proto_depIdxs = []int32{ 24, // 32: seaweedfs.block.control.LifecycleService.CreateVolume:input_type -> seaweedfs.block.control.CreateVolumeRequest 26, // 33: seaweedfs.block.control.LifecycleService.DeleteVolume:input_type -> seaweedfs.block.control.DeleteVolumeRequest 28, // 34: seaweedfs.block.control.LifecycleService.MarkVolumeDeleting:input_type -> seaweedfs.block.control.MarkVolumeDeletingRequest - 30, // 35: seaweedfs.block.control.FailbackService.ExecuteFailback:input_type -> seaweedfs.block.control.FailbackRequest - 3, // 36: seaweedfs.block.control.ObservationService.ReportHeartbeat:output_type -> seaweedfs.block.control.HeartbeatAck - 4, // 37: seaweedfs.block.control.ObservationService.ReportClusterEvent:output_type -> seaweedfs.block.control.ClusterEventAck - 7, // 38: seaweedfs.block.control.AssignmentService.SubscribeAssignments:output_type -> seaweedfs.block.control.AssignmentFact - 9, // 39: seaweedfs.block.control.EvidenceService.QueryVolumeStatus:output_type -> seaweedfs.block.control.StatusResponse - 17, // 40: seaweedfs.block.control.ClusterEvidenceService.GetClusterStatus:output_type -> seaweedfs.block.control.ClusterStatusResponse - 22, // 41: seaweedfs.block.control.ClusterEvidenceService.ListVolumes:output_type -> seaweedfs.block.control.ListVolumesResponse - 19, // 42: seaweedfs.block.control.ClusterEvidenceService.GetVolumeStatus:output_type -> seaweedfs.block.control.VolumeEvidence - 23, // 43: seaweedfs.block.control.ClusterEvidenceService.GetVolumeTimeline:output_type -> seaweedfs.block.control.VolumeTimelineResponse - 21, // 44: seaweedfs.block.control.ClusterEvidenceService.WatchClusterEvents:output_type -> seaweedfs.block.control.ClusterEvent - 25, // 45: seaweedfs.block.control.LifecycleService.CreateVolume:output_type -> seaweedfs.block.control.CreateVolumeResponse - 27, // 46: seaweedfs.block.control.LifecycleService.DeleteVolume:output_type -> seaweedfs.block.control.DeleteVolumeResponse - 29, // 47: seaweedfs.block.control.LifecycleService.MarkVolumeDeleting:output_type -> seaweedfs.block.control.MarkVolumeDeletingResponse - 31, // 48: seaweedfs.block.control.FailbackService.ExecuteFailback:output_type -> seaweedfs.block.control.FailbackResponse - 36, // [36:49] is the sub-list for method output_type - 23, // [23:36] is the sub-list for method input_type + 28, // 35: seaweedfs.block.control.LifecycleService.AbortVolumeDeleting:input_type -> seaweedfs.block.control.MarkVolumeDeletingRequest + 28, // 36: seaweedfs.block.control.LifecycleService.CommitVolumeDeleting:input_type -> seaweedfs.block.control.MarkVolumeDeletingRequest + 30, // 37: seaweedfs.block.control.FailbackService.ExecuteFailback:input_type -> seaweedfs.block.control.FailbackRequest + 3, // 38: seaweedfs.block.control.ObservationService.ReportHeartbeat:output_type -> seaweedfs.block.control.HeartbeatAck + 4, // 39: seaweedfs.block.control.ObservationService.ReportClusterEvent:output_type -> seaweedfs.block.control.ClusterEventAck + 7, // 40: seaweedfs.block.control.AssignmentService.SubscribeAssignments:output_type -> seaweedfs.block.control.AssignmentFact + 9, // 41: seaweedfs.block.control.EvidenceService.QueryVolumeStatus:output_type -> seaweedfs.block.control.StatusResponse + 17, // 42: seaweedfs.block.control.ClusterEvidenceService.GetClusterStatus:output_type -> seaweedfs.block.control.ClusterStatusResponse + 22, // 43: seaweedfs.block.control.ClusterEvidenceService.ListVolumes:output_type -> seaweedfs.block.control.ListVolumesResponse + 19, // 44: seaweedfs.block.control.ClusterEvidenceService.GetVolumeStatus:output_type -> seaweedfs.block.control.VolumeEvidence + 23, // 45: seaweedfs.block.control.ClusterEvidenceService.GetVolumeTimeline:output_type -> seaweedfs.block.control.VolumeTimelineResponse + 21, // 46: seaweedfs.block.control.ClusterEvidenceService.WatchClusterEvents:output_type -> seaweedfs.block.control.ClusterEvent + 25, // 47: seaweedfs.block.control.LifecycleService.CreateVolume:output_type -> seaweedfs.block.control.CreateVolumeResponse + 27, // 48: seaweedfs.block.control.LifecycleService.DeleteVolume:output_type -> seaweedfs.block.control.DeleteVolumeResponse + 29, // 49: seaweedfs.block.control.LifecycleService.MarkVolumeDeleting:output_type -> seaweedfs.block.control.MarkVolumeDeletingResponse + 29, // 50: seaweedfs.block.control.LifecycleService.AbortVolumeDeleting:output_type -> seaweedfs.block.control.MarkVolumeDeletingResponse + 29, // 51: seaweedfs.block.control.LifecycleService.CommitVolumeDeleting:output_type -> seaweedfs.block.control.MarkVolumeDeletingResponse + 31, // 52: seaweedfs.block.control.FailbackService.ExecuteFailback:output_type -> seaweedfs.block.control.FailbackResponse + 38, // [38:53] is the sub-list for method output_type + 23, // [23:38] is the sub-list for method input_type 23, // [23:23] is the sub-list for extension type_name 23, // [23:23] is the sub-list for extension extendee 0, // [0:23] is the sub-list for field type_name diff --git a/seaweed-block/core/rpc/control/control_grpc.pb.go b/seaweed-block/core/rpc/control/control_grpc.pb.go index 782938a259..cb2855bebf 100644 --- a/seaweed-block/core/rpc/control/control_grpc.pb.go +++ b/seaweed-block/core/rpc/control/control_grpc.pb.go @@ -665,9 +665,11 @@ var ClusterEvidenceService_ServiceDesc = grpc.ServiceDesc{ } const ( - LifecycleService_CreateVolume_FullMethodName = "/seaweedfs.block.control.LifecycleService/CreateVolume" - LifecycleService_DeleteVolume_FullMethodName = "/seaweedfs.block.control.LifecycleService/DeleteVolume" - LifecycleService_MarkVolumeDeleting_FullMethodName = "/seaweedfs.block.control.LifecycleService/MarkVolumeDeleting" + LifecycleService_CreateVolume_FullMethodName = "/seaweedfs.block.control.LifecycleService/CreateVolume" + LifecycleService_DeleteVolume_FullMethodName = "/seaweedfs.block.control.LifecycleService/DeleteVolume" + LifecycleService_MarkVolumeDeleting_FullMethodName = "/seaweedfs.block.control.LifecycleService/MarkVolumeDeleting" + LifecycleService_AbortVolumeDeleting_FullMethodName = "/seaweedfs.block.control.LifecycleService/AbortVolumeDeleting" + LifecycleService_CommitVolumeDeleting_FullMethodName = "/seaweedfs.block.control.LifecycleService/CommitVolumeDeleting" ) // LifecycleServiceClient is the client API for LifecycleService service. @@ -676,13 +678,18 @@ const ( type LifecycleServiceClient interface { CreateVolume(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) DeleteVolume(ctx context.Context, in *DeleteVolumeRequest, opts ...grpc.CallOption) (*DeleteVolumeResponse, error) - // MarkVolumeDeleting is the admission of a chunk volume delete: under - // the same locks as every assignment, placement and binding write it - // refuses (FAILED_PRECONDITION) a volume with live or pending authority, - // and otherwise marks the lifecycle record deleting, after which no new - // assignment, placement or binding is admitted and the id is never - // created again. + // MarkVolumeDeleting admits a chunk volume delete: under the same locks + // as every assignment, placement and binding write it refuses + // (FAILED_PRECONDITION) a volume with live or pending authority, and + // otherwise records the delete's token in a durable deletion + // reservation, independent of the volume record. While reserved, no + // new assignment, placement or binding is admitted and the id is not + // created again. AbortVolumeDeleting gives a token back (the + // reservation goes with its last token); CommitVolumeDeleting makes it + // permanent (never given back). MarkVolumeDeleting(ctx context.Context, in *MarkVolumeDeletingRequest, opts ...grpc.CallOption) (*MarkVolumeDeletingResponse, error) + AbortVolumeDeleting(ctx context.Context, in *MarkVolumeDeletingRequest, opts ...grpc.CallOption) (*MarkVolumeDeletingResponse, error) + CommitVolumeDeleting(ctx context.Context, in *MarkVolumeDeletingRequest, opts ...grpc.CallOption) (*MarkVolumeDeletingResponse, error) } type lifecycleServiceClient struct { @@ -720,19 +727,42 @@ func (c *lifecycleServiceClient) MarkVolumeDeleting(ctx context.Context, in *Mar return out, nil } +func (c *lifecycleServiceClient) AbortVolumeDeleting(ctx context.Context, in *MarkVolumeDeletingRequest, opts ...grpc.CallOption) (*MarkVolumeDeletingResponse, error) { + out := new(MarkVolumeDeletingResponse) + err := c.cc.Invoke(ctx, LifecycleService_AbortVolumeDeleting_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *lifecycleServiceClient) CommitVolumeDeleting(ctx context.Context, in *MarkVolumeDeletingRequest, opts ...grpc.CallOption) (*MarkVolumeDeletingResponse, error) { + out := new(MarkVolumeDeletingResponse) + err := c.cc.Invoke(ctx, LifecycleService_CommitVolumeDeleting_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // LifecycleServiceServer is the server API for LifecycleService service. // All implementations must embed UnimplementedLifecycleServiceServer // for forward compatibility type LifecycleServiceServer interface { CreateVolume(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error) DeleteVolume(context.Context, *DeleteVolumeRequest) (*DeleteVolumeResponse, error) - // MarkVolumeDeleting is the admission of a chunk volume delete: under - // the same locks as every assignment, placement and binding write it - // refuses (FAILED_PRECONDITION) a volume with live or pending authority, - // and otherwise marks the lifecycle record deleting, after which no new - // assignment, placement or binding is admitted and the id is never - // created again. + // MarkVolumeDeleting admits a chunk volume delete: under the same locks + // as every assignment, placement and binding write it refuses + // (FAILED_PRECONDITION) a volume with live or pending authority, and + // otherwise records the delete's token in a durable deletion + // reservation, independent of the volume record. While reserved, no + // new assignment, placement or binding is admitted and the id is not + // created again. AbortVolumeDeleting gives a token back (the + // reservation goes with its last token); CommitVolumeDeleting makes it + // permanent (never given back). MarkVolumeDeleting(context.Context, *MarkVolumeDeletingRequest) (*MarkVolumeDeletingResponse, error) + AbortVolumeDeleting(context.Context, *MarkVolumeDeletingRequest) (*MarkVolumeDeletingResponse, error) + CommitVolumeDeleting(context.Context, *MarkVolumeDeletingRequest) (*MarkVolumeDeletingResponse, error) mustEmbedUnimplementedLifecycleServiceServer() } @@ -749,6 +779,12 @@ func (UnimplementedLifecycleServiceServer) DeleteVolume(context.Context, *Delete func (UnimplementedLifecycleServiceServer) MarkVolumeDeleting(context.Context, *MarkVolumeDeletingRequest) (*MarkVolumeDeletingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarkVolumeDeleting not implemented") } +func (UnimplementedLifecycleServiceServer) AbortVolumeDeleting(context.Context, *MarkVolumeDeletingRequest) (*MarkVolumeDeletingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AbortVolumeDeleting not implemented") +} +func (UnimplementedLifecycleServiceServer) CommitVolumeDeleting(context.Context, *MarkVolumeDeletingRequest) (*MarkVolumeDeletingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommitVolumeDeleting not implemented") +} func (UnimplementedLifecycleServiceServer) mustEmbedUnimplementedLifecycleServiceServer() {} // UnsafeLifecycleServiceServer may be embedded to opt out of forward compatibility for this service. @@ -816,6 +852,42 @@ func _LifecycleService_MarkVolumeDeleting_Handler(srv interface{}, ctx context.C return interceptor(ctx, in, info, handler) } +func _LifecycleService_AbortVolumeDeleting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MarkVolumeDeletingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LifecycleServiceServer).AbortVolumeDeleting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LifecycleService_AbortVolumeDeleting_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LifecycleServiceServer).AbortVolumeDeleting(ctx, req.(*MarkVolumeDeletingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LifecycleService_CommitVolumeDeleting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MarkVolumeDeletingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LifecycleServiceServer).CommitVolumeDeleting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LifecycleService_CommitVolumeDeleting_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LifecycleServiceServer).CommitVolumeDeleting(ctx, req.(*MarkVolumeDeletingRequest)) + } + return interceptor(ctx, in, info, handler) +} + // LifecycleService_ServiceDesc is the grpc.ServiceDesc for LifecycleService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -835,6 +907,14 @@ var LifecycleService_ServiceDesc = grpc.ServiceDesc{ MethodName: "MarkVolumeDeleting", Handler: _LifecycleService_MarkVolumeDeleting_Handler, }, + { + MethodName: "AbortVolumeDeleting", + Handler: _LifecycleService_AbortVolumeDeleting_Handler, + }, + { + MethodName: "CommitVolumeDeleting", + Handler: _LifecycleService_CommitVolumeDeleting_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "control.proto", diff --git a/seaweed-block/core/rpc/proto/control.proto b/seaweed-block/core/rpc/proto/control.proto index defa92a336..1efa3f4021 100644 --- a/seaweed-block/core/rpc/proto/control.proto +++ b/seaweed-block/core/rpc/proto/control.proto @@ -84,13 +84,18 @@ service ClusterEvidenceService { service LifecycleService { rpc CreateVolume(CreateVolumeRequest) returns (CreateVolumeResponse); rpc DeleteVolume(DeleteVolumeRequest) returns (DeleteVolumeResponse); - // MarkVolumeDeleting is the admission of a chunk volume delete: under - // the same locks as every assignment, placement and binding write it - // refuses (FAILED_PRECONDITION) a volume with live or pending authority, - // and otherwise marks the lifecycle record deleting, after which no new - // assignment, placement or binding is admitted and the id is never - // created again. + // MarkVolumeDeleting admits a chunk volume delete: under the same locks + // as every assignment, placement and binding write it refuses + // (FAILED_PRECONDITION) a volume with live or pending authority, and + // otherwise records the delete's token in a durable deletion + // reservation, independent of the volume record. While reserved, no + // new assignment, placement or binding is admitted and the id is not + // created again. AbortVolumeDeleting gives a token back (the + // reservation goes with its last token); CommitVolumeDeleting makes it + // permanent (never given back). rpc MarkVolumeDeleting(MarkVolumeDeletingRequest) returns (MarkVolumeDeletingResponse); + rpc AbortVolumeDeleting(MarkVolumeDeletingRequest) returns (MarkVolumeDeletingResponse); + rpc CommitVolumeDeleting(MarkVolumeDeletingRequest) returns (MarkVolumeDeletingResponse); } // FailbackService — disabled-by-default authority failback endpoint. @@ -413,12 +418,17 @@ message DeleteVolumeResponse { message MarkVolumeDeletingRequest { string volume_id = 1; + // token identifies one delete operation (chosen by the caller). + string token = 2; } message MarkVolumeDeletingResponse { - // known is false when the master has no lifecycle record for the volume - // (it then only checked that no authority is live or pending). + // known is true when the master also has a lifecycle record for the + // volume (the reservation applies either way). bool known = 1; + // state is the reservation after the call: "admitted", "committed" or + // "" (none left). + string state = 2; } message FailbackRequest { diff --git a/seaweed-block/core/storage/chunk_public.go b/seaweed-block/core/storage/chunk_public.go index aac1685333..a81d157e2f 100644 --- a/seaweed-block/core/storage/chunk_public.go +++ b/seaweed-block/core/storage/chunk_public.go @@ -28,6 +28,7 @@ const ( ChunkHeadDetached = chunkHeadDetached ChunkHeadAborted = chunkHeadAborted ChunkHeadDeleting = chunkHeadDeleting + ChunkHeadPurging = chunkHeadPurging ChunkHeadDeleted = chunkHeadDeleted ) diff --git a/seaweed-block/core/storage/chunk_seam.go b/seaweed-block/core/storage/chunk_seam.go index 858dcf3e41..3d5e01fa1c 100644 --- a/seaweed-block/core/storage/chunk_seam.go +++ b/seaweed-block/core/storage/chunk_seam.go @@ -207,8 +207,11 @@ const chunkHeadAborted = "aborted" // the delete can still be given back); chunkHeadDeleted is the final // tombstone (no chunks, so nothing it held stays a GC root). Neither is // ever moved by CASHead, so no attach, claim or restore can revive them. +// chunkHeadPurging is the delete's irreversible boundary (chunks still +// kept until the final tombstone). const ( chunkHeadDeleting = "deleting" + chunkHeadPurging = "purging" chunkHeadDeleted = "deleted" )