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
c6086677
Commit
c6086677
authored
8 years ago
by
Diptanu Choudhury
Browse files
Options
Download
Email Patches
Plain Diff
Fixed a bug
parent
1cccc8fd
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nomad/state/state_store.go
+12
-11
nomad/state/state_store.go
with
12 additions
and
11 deletions
+12
-11
nomad/state/state_store.go
+
12
-
11
View file @
c6086677
...
...
@@ -977,6 +977,18 @@ func (s *StateStore) UpsertAllocs(index uint64, allocs []*structs.Allocation) er
}
exist
,
_
:=
existing
.
(
*
structs
.
Allocation
)
if
exist
==
nil
{
alloc
.
CreateIndex
=
index
alloc
.
ModifyIndex
=
index
alloc
.
AllocModifyIndex
=
index
}
else
{
alloc
.
CreateIndex
=
exist
.
CreateIndex
alloc
.
ModifyIndex
=
index
alloc
.
AllocModifyIndex
=
index
alloc
.
ClientStatus
=
exist
.
ClientStatus
alloc
.
ClientDescription
=
exist
.
ClientDescription
}
rawJob
,
err
:=
txn
.
First
(
"jobs"
,
"id"
,
alloc
.
JobID
)
if
alloc
.
ID
==
"de31d58e-fdda-f8f8-4e6a-227f7b6e1564"
{
s
.
logger
.
Printf
(
"DIPTANU UPSERT ALLOC: Index: %v, ID: %v, TG: %v, Name: %v, ClientStatus: %v, Desired Status: %v,
\n
RAW JOB %v"
,
index
,
alloc
.
ID
,
alloc
.
TaskGroup
,
...
...
@@ -991,17 +1003,6 @@ func (s *StateStore) UpsertAllocs(index uint64, allocs []*structs.Allocation) er
}
}
if
exist
==
nil
{
alloc
.
CreateIndex
=
index
alloc
.
ModifyIndex
=
index
alloc
.
AllocModifyIndex
=
index
}
else
{
alloc
.
CreateIndex
=
exist
.
CreateIndex
alloc
.
ModifyIndex
=
index
alloc
.
AllocModifyIndex
=
index
alloc
.
ClientStatus
=
exist
.
ClientStatus
alloc
.
ClientDescription
=
exist
.
ClientDescription
}
if
err
:=
txn
.
Insert
(
"allocs"
,
alloc
);
err
!=
nil
{
return
fmt
.
Errorf
(
"alloc insert failed: %v"
,
err
)
}
...
...
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