Skip to content

Commit

Permalink
remove temporarily broken state store code
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Jun 17, 2022
1 parent 2f7f862 commit 6fab937
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions nomad/plan_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion nomad/plan_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 0 additions & 10 deletions nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand All @@ -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.
Expand Down

0 comments on commit 6fab937

Please sign in to comment.