Skip to content

Commit

Permalink
Merge b71440a into backport/eval-safe-delete-filter/constantly-ace-ma…
Browse files Browse the repository at this point in the history
…ntis
  • Loading branch information
hc-github-team-nomad-core committed Nov 14, 2022
2 parents ab09f43 + b71440a commit 1cb8aae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion command/eval_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Eval Delete Options:
-filter
Specifies an expression used to filter evaluations by for deletion. When
using this flag, it is advisable to ensure the syntax is correct using the
eval list command first.
eval list command first. Note that deleting evals by filter is imprecise:
for sets of evals larger than a single raft log batch, evals can be inserted
behind the cursor and therefore be missed.
-yes
Bypass the confirmation prompt if an evaluation ID was not provided.
Expand Down
10 changes: 5 additions & 5 deletions nomad/eval_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,11 @@ func (e *Eval) deleteEvalsByFilter(args *structs.EvalDeleteRequest) (int, uint64
return count, index, err
}

// Note that deleting evals by filter is imprecise: For sets of evals larger
// than a single batch eval inserts may occur behind the cursor and therefore
// be missed. This imprecision is not considered to hurt this endpoint's
// purpose of reducing pressure on servers during periods of heavy scheduling
// activity.
// Note that deleting evals by filter is imprecise: For sets of evals larger
// than a single batch eval inserts may occur behind the cursor and therefore
// be missed. This imprecision is not considered to hurt this endpoint's
// purpose of reducing pressure on servers during periods of heavy scheduling
// activity.
snap, err := e.srv.State().Snapshot()
if err != nil {
return count, index, fmt.Errorf("failed to lookup state snapshot: %v", err)
Expand Down
5 changes: 4 additions & 1 deletion website/content/docs/commands/eval/delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ When ACLs are enabled, this command requires a `management` token.
## Delete Options

- `-filter`: Specifies an expression used to filter evaluations by for
deletion.
deletion. When using this flag, it is advisable to ensure the syntax is
correct using the eval list command first. Note that deleting evals by filter
is imprecise: for sets of evals larger than a single raft log batch, evals can
be inserted behind the cursor and therefore be missed.

- `-yes`: Bypass the confirmation prompt if an evaluation ID was not provided.

Expand Down

0 comments on commit 1cb8aae

Please sign in to comment.