Commit Graph

26 Commits

Author SHA1 Message Date
James Rasell
d49cf2388a Merge branch 'main' into f-1.3-boogie-nights 2022-03-23 09:41:25 +01:00
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
Luiz Aoqui
154264fcd9 Add pagination, filtering and sort to more API endpoints (#12186) 2022-03-08 20:54:17 -05:00
James Rasell
12265ee9d1 events: add state objects and logic for service registrations. 2022-02-28 10:44:58 +01:00
Seth Hoenig
42c6d5a5c5 command: switch from raft-boltdb to raft-boltdb/v2 2022-02-23 14:43:59 -06:00
Seth Hoenig
b2fe196e42 agent: switch to go.etc.io/bbolt for state store
This PR modifies the server and client agents to use `go.etc.io/bbolt` as the
implementation for their state stores.
2022-02-23 14:28:31 -06:00
Seth Hoenig
b432f377cf api: return sorted results in certain list endpoints
These API endpoints now return results in chronological order. They
can return results in reverse chronological order by setting the
query parameter ascending=true.

- Eval.List
- Deployment.List
2022-02-15 13:48:28 -06:00
Michael Schurter
fa3de735cf cli: return error from raft commands if db is open
Before this change trying to run `nomad operator raft {info,logs}` on an
inuse raft.db would cause the command to block until the agent using
raft.db is closed.

After this change the command will block for 1s before returning a
(hopefully) helpful error message.

This change also sets the ReadOnly mode on the underlying BoltDb to
ensure diagnostics make no changes to the underlying store. We have no
evidence this has ever occurred, but it seems like a useful safety
measure.

No changelog added since this is a minor tweak in a "new" feature (it
was hidden in previous relases).
2021-12-16 11:41:01 -08:00
Tim Gross
bd18a452ab cli: stream raft logs to operator raft logs subcommand (#11684)
The `nomad operator raft logs` command uses a raft helper that reads
in the logs from raft and serializes them to JSON. The previous
implementation returned the slice of all logs and then serializes the
entire object. Update the helper to stream the log entries and then
serialize them as newline-delimited JSON.
2021-12-16 13:38:58 -05:00
Mahmood Ali
68bae12fd4 Raft Debugging Improvements (#11414) 2021-11-04 10:16:12 -04:00
Mahmood Ali
6c414cd5f9 gofmt all the files
mostly to handle build directives in 1.17.
2021-10-01 10:14:28 -04:00
Tim Gross
a12f44705a RPC endpoints to support 'nomad ui -login'
RPC endpoints for the user-driven APIs (`UpsertOneTimeToken` and
`ExchangeOneTimeToken`) and token expiration (`ExpireOneTimeTokens`).
Includes adding expiration to the periodic core GC job.
2021-03-10 08:17:56 -05:00
Drew Bailey
da45c95956 Send events to EventSinks (#9171)
* Process to send events to configured sinks

This PR adds a SinkManager to a server which is responsible for managing
managed sinks. Managed sinks subscribe to the event broker and send
events to a sink writer (webhook). When changes to the eventstore are
made the sinkmanager and managed sink are responsible for reloading or
starting a new managed sink.

* periodically check in sink progress to raft

Save progress on the last successfully sent index to raft. This allows a
managed sink to resume close to where it left off in the event of a lost
server or leadership change

dereference eventsink so we can accurately use the watchch

When using a pointer to eventsink struct it was updated immediately and our reload logic would not trigger
2020-10-26 17:27:54 -04:00
Drew Bailey
fbb199d416 event sink crud operation api (#9155)
* network sink rpc/api plumbing

state store methods and restore

upsert sink test

get sink

delete sink

event sink list and tests

go generate new msg types

validate sink on upsert

* go generate
2020-10-23 14:23:00 -04:00
Michael Schurter
6c2f589ed0 Update generate_msgtypes.sh now that iota is gone 2020-10-22 15:26:32 -07:00
davemay99
5ab5c25fb5 return explicit error if not found/empty path falls through 2020-09-29 14:55:28 -04:00
davemay99
3aaf32d1a3 satisfy the linter 2020-09-29 01:37:15 -04:00
davemay99
a90f66eab9 reverting export of fixTime 2020-09-29 01:21:03 -04:00
davemay99
77c780598d finish refactoring walk to search for any file 2020-09-29 01:17:10 -04:00
davemay99
32c24afcba refactor functions to find raft.db 2020-09-24 19:00:53 -04:00
davemay99
36c88b536a logging tweaks 2020-09-24 17:30:50 -04:00
davemay99
c5cd1990f6 export FixTime to allow external use 2020-09-24 16:47:58 -04:00
davemay99
c301e8c5cf add missing import 2020-09-21 11:20:08 -04:00
davemay99
0bfbba4d98 Raftutil cleanup, plus helper function to find raft.db 2020-09-17 21:35:17 -04:00
davemay99
ad6fa9aa4d Verify iter to avoid panic 2020-09-08 14:10:38 -04:00
Mahmood Ali
1896b8f7dd add helper commands for debugging state 2020-08-31 08:45:59 -04:00