From 6fab93703fc70a7440a6e4fbd7dd5d7e5bcb81db Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 17 Jun 2022 14:08:45 -0400 Subject: [PATCH] remove temporarily broken state store code --- nomad/plan_apply.go | 2 -- nomad/plan_endpoint_test.go | 2 +- nomad/state/state_store.go | 10 ---------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/nomad/plan_apply.go b/nomad/plan_apply.go index 8a1cd7caa304..0e7e998cff58 100644 --- a/nomad/plan_apply.go +++ b/nomad/plan_apply.go @@ -153,9 +153,7 @@ func (p *planner) planApply() { // Ensure any parallel apply is complete before starting the next one. // This also limits how out of date our snapshot can be. if planIndexCh != nil { - fmt.Println("waiting for idx...") // DEBUG idx := <-planIndexCh - fmt.Println("got index", idx) // DEBUG prevPlanResultIndex = max(prevPlanResultIndex, idx) snap, err = p.snapshotMinIndex(prevPlanResultIndex, pending.plan.SnapshotIndex) if err != nil { diff --git a/nomad/plan_endpoint_test.go b/nomad/plan_endpoint_test.go index 963be8972ca4..c36cb4f1989d 100644 --- a/nomad/plan_endpoint_test.go +++ b/nomad/plan_endpoint_test.go @@ -131,7 +131,7 @@ func TestPlanEndpoint_Submit_Bad(t *testing.T) { require.Zero(t, s1.planner.planQueue.Stats().Depth) } -func TestPlanEndpoint_ApplyDeadlock(t *testing.T) { +func TestPlanEndpoint_ApplyConcurrent(t *testing.T) { t.Parallel() s1, cleanupS1 := TestServer(t, func(c *Config) { diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index bc48130d7801..6c5fabdda054 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -204,9 +204,6 @@ func (s *StateStore) Snapshot() (*StateSnapshot, error) { return snap, nil } -// DEBUG: this is to introduce a one-time timeout -var stop = true - // SnapshotMinIndex is used to create a state snapshot where the index is // guaranteed to be greater than or equal to the index parameter. // @@ -225,13 +222,6 @@ func (s *StateStore) SnapshotMinIndex(ctx context.Context, index uint64) (*State var retries uint var retryTimer *time.Timer - // DEBUG: this is to introduce a one-time timeout - if index == 7 && stop { - stop = false - time.Sleep(6000 * time.Millisecond) - return nil, ctx.Err() - } - // XXX: Potential optimization is to set up a watch on the state // store's index table and only unblock via a trigger rather than // polling.