Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
35d31f8b
Unverified
Commit
35d31f8b
authored
6 years ago
by
Preetha Appan
Browse files
Options
Download
Email Patches
Plain Diff
more minor review feedback
parent
06ad1820
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
api/jobs.go
+1
-1
api/jobs.go
nomad/leader.go
+8
-3
nomad/leader.go
nomad/state/state_store.go
+2
-2
nomad/state/state_store.go
nomad/structs/structs.go
+1
-0
nomad/structs/structs.go
with
12 additions
and
6 deletions
+12
-6
api/jobs.go
+
1
-
1
View file @
35d31f8b
...
...
@@ -1024,7 +1024,7 @@ type DesiredUpdates struct {
InPlaceUpdate
uint64
DestructiveUpdate
uint64
Canary
uint64
Evict
uint64
Preemptions
uint64
}
type
JobDispatchRequest
struct
{
...
...
This diff is collapsed.
Click to expand it.
nomad/leader.go
+
8
-
3
View file @
35d31f8b
...
...
@@ -42,8 +42,12 @@ const (
var
minAutopilotVersion
=
version
.
Must
(
version
.
NewVersion
(
"0.8.0"
))
// Default configuration for scheduler with preemption emabled for system jobs
var
defaultSchedulerConfig
=
&
structs
.
SchedulerConfiguration
{
PreemptionConfig
:
structs
.
PreemptionConfig
{
SystemSchedulerEnabled
:
true
}}
// Default configuration for scheduler with preemption enabled for system jobs
var
defaultSchedulerConfig
=
&
structs
.
SchedulerConfiguration
{
PreemptionConfig
:
structs
.
PreemptionConfig
{
SystemSchedulerEnabled
:
true
,
},
}
// monitorLeadership is used to monitor if we acquire or lose our role
// as the leader in the Raft cluster. There is some work the leader is
...
...
@@ -1237,7 +1241,8 @@ func (s *Server) getOrCreateAutopilotConfig() *structs.AutopilotConfig {
return
config
}
// getOrCreateSchedulerConfig is used to get the scheduler config, initializing it if necessary
// getOrCreateSchedulerConfig is used to get the scheduler config. We create a default
// config if it doesn't already exist for bootstrapping an empty cluster
func
(
s
*
Server
)
getOrCreateSchedulerConfig
()
*
structs
.
SchedulerConfiguration
{
state
:=
s
.
fsm
.
State
()
_
,
config
,
err
:=
state
.
SchedulerConfig
()
...
...
This diff is collapsed.
Click to expand it.
nomad/state/state_store.go
+
2
-
2
View file @
35d31f8b
...
...
@@ -3889,9 +3889,9 @@ func (s *StateStore) SchedulerSetConfig(idx uint64, config *structs.SchedulerCon
return
nil
}
// SchedulerCASConfig is used to
try
updat
ing
the scheduler configuration with a
// SchedulerCASConfig is used to updat
e
the scheduler configuration with a
// given Raft index. If the CAS index specified is not equal to the last observed index
// for the config, then the call is a noop
,
// for the config, then the call is a noop
.
func
(
s
*
StateStore
)
SchedulerCASConfig
(
idx
,
cidx
uint64
,
config
*
structs
.
SchedulerConfiguration
)
(
bool
,
error
)
{
tx
:=
s
.
db
.
Txn
(
true
)
defer
tx
.
Abort
()
...
...
This diff is collapsed.
Click to expand it.
nomad/structs/structs.go
+
1
-
0
View file @
35d31f8b
...
...
@@ -8176,6 +8176,7 @@ func (p *Plan) AppendPreemptedAlloc(alloc *Allocation, desiredStatus, preempting
if
alloc
.
AllocatedResources
!=
nil
{
newAlloc
.
AllocatedResources
=
alloc
.
AllocatedResources
}
else
{
// COMPAT Remove in version 0.11
newAlloc
.
TaskResources
=
alloc
.
TaskResources
newAlloc
.
SharedResources
=
alloc
.
SharedResources
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help