You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Bannier <be...@mesosphere.io> on 2018/10/25 10:47:23 UTC
Review Request 69157: Fixed handling for offer operation updates.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/
-----------------------------------------------------------
Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
Bugs: MESOS-8403
https://issues.apache.org/jira/browse/MESOS-8403
Repository: mesos
Description
-------
The handling of offer operation updates introduced in `c946615ec6d`
made use of an update's `latest_status` without makeing sure that any
value was set. This could leave to situation where an uninitialized
enum value was switched on would would have caused a fatal error at
runtime.
This patch replaces uses of `latest_status` with `state` which does
contain the information we care about. We also adjust the error
logging so we log the value that lead to the error, not some other
value.
Diffs
-----
src/slave/slave.cpp 7bb2b291a7b67563adf88bcedca1392890f17ffe
Diff: https://reviews.apache.org/r/69157/diff/1/
Testing
-------
`make check`
Thanks,
Benjamin Bannier
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Greg Mann <gr...@mesosphere.io>.
> On Nov. 27, 2018, 11:40 p.m., Greg Mann wrote:
> > src/slave/slave.cpp
> > Line 8037 (original), 8037 (patched)
> > <https://reviews.apache.org/r/69157/diff/5/?file=2110681#file2110681line8037>
> >
> > Hmm it looks like Chun-Hung's comment was resolved, but this line still uses `update` instead of `operation`?
Whoops sorry for the double-comment.
- Greg
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210897
-----------------------------------------------------------
On Nov. 27, 2018, 5:59 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 27, 2018, 5:59 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/5/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210897
-----------------------------------------------------------
src/slave/slave.cpp
Lines 8016-8037 (original), 8016-8037 (patched)
<https://reviews.apache.org/r/69157/#comment295741>
Hmm I think you may have mis-read Chun-Hung's comment here - I think he was suggesting that we use `operation->latest_status().state()` in both places?
src/slave/slave.cpp
Line 8037 (original), 8037 (patched)
<https://reviews.apache.org/r/69157/#comment295715>
Hmm it looks like Chun-Hung's comment was resolved, but this line still uses `update` instead of `operation`?
- Greg Mann
On Nov. 27, 2018, 5:59 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 27, 2018, 5:59 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/5/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210932
-----------------------------------------------------------
Ship it!
Ship It!
- Greg Mann
On Nov. 27, 2018, 5:59 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 27, 2018, 5:59 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/6/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/
-----------------------------------------------------------
(Updated Nov. 27, 2018, 6:59 p.m.)
Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
Bugs: MESOS-8403
https://issues.apache.org/jira/browse/MESOS-8403
Repository: mesos
Description
-------
The handling of offer operation updates introduced in `c946615ec6d`
made use of an update's `latest_status` without making sure that any
value was set. This could lead to situation where an uninitialized
enum value was switched on which would have caused a fatal error at
runtime.
This patch replaces uses of `latest_status` with `state` which does
contain the information we care about. We also adjust the error
logging so we log the value that lead to the error, not some other
value.
Diffs (updated)
-----
src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
Diff: https://reviews.apache.org/r/69157/diff/5/
Changes: https://reviews.apache.org/r/69157/diff/4-5/
Testing
-------
`make check`
Thanks,
Benjamin Bannier
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Benjamin Bannier <be...@mesosphere.io>.
> On Nov. 20, 2018, 8:05 p.m., Chun-Hung Hsiao wrote:
> > Could you update the commit message accordingly?
Do you have a suggestion?
- Benjamin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210737
-----------------------------------------------------------
On Nov. 27, 2018, 6:59 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 27, 2018, 6:59 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/5/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210737
-----------------------------------------------------------
Fix it, then Ship it!
Could you update the commit message accordingly?
src/slave/slave.cpp
Line 8037 (original), 8037 (patched)
<https://reviews.apache.org/r/69157/#comment295484>
`operation->latest_status().state()`
It's interesting that we used `operation` here but not in the `switch` condition lol.
- Chun-Hung Hsiao
On Nov. 20, 2018, 5:50 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 20, 2018, 5:50 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/4/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/
-----------------------------------------------------------
(Updated Nov. 20, 2018, 6:50 p.m.)
Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
Changes
-------
Addressed comment from Chun.
Bugs: MESOS-8403
https://issues.apache.org/jira/browse/MESOS-8403
Repository: mesos
Description
-------
The handling of offer operation updates introduced in `c946615ec6d`
made use of an update's `latest_status` without making sure that any
value was set. This could lead to situation where an uninitialized
enum value was switched on which would have caused a fatal error at
runtime.
This patch replaces uses of `latest_status` with `state` which does
contain the information we care about. We also adjust the error
logging so we log the value that lead to the error, not some other
value.
Diffs (updated)
-----
src/slave/slave.cpp 858b78620e1ef33f3587d0bd95a684917aaf5bbb
Diff: https://reviews.apache.org/r/69157/diff/4/
Changes: https://reviews.apache.org/r/69157/diff/3-4/
Testing
-------
`make check`
Thanks,
Benjamin Bannier
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Jan Schlicht <ja...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210540
-----------------------------------------------------------
Ship it!
Ship It!
- Jan Schlicht
On Nov. 13, 2018, 10:10 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 10:10 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 74f6fb9036a9ac4f587f53ec2df04eeb4c167bfb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/3/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/#review210692
-----------------------------------------------------------
src/slave/slave.cpp
Line 8017 (original), 8017 (patched)
<https://reviews.apache.org/r/69157/#comment295414>
If the `latest_status` is not in sync with `status`, then this would lead to an inconcistency between the resource bookkeeping of the master and the agent:
https://github.com/apache/mesos/blob/master/src/master/master.cpp#L11212
Since the master recovers and re-offers the converted resources based on the latest status, the framework might get the converted resources and use them before it acks any intermediate nonterminal status, which would lead to a failure at the agent side since the agent's bookkeeping is not based on the latest status.
Instead we should do the following since `latest_status` has been updated in Line 7964--7976:
```
switch (operation->latest_status().state()) {
```
- Chun-Hung Hsiao
On Nov. 13, 2018, 9:10 p.m., Benjamin Bannier wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69157/
> -----------------------------------------------------------
>
> (Updated Nov. 13, 2018, 9:10 p.m.)
>
>
> Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
>
>
> Bugs: MESOS-8403
> https://issues.apache.org/jira/browse/MESOS-8403
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The handling of offer operation updates introduced in `c946615ec6d`
> made use of an update's `latest_status` without making sure that any
> value was set. This could lead to situation where an uninitialized
> enum value was switched on which would have caused a fatal error at
> runtime.
>
> This patch replaces uses of `latest_status` with `state` which does
> contain the information we care about. We also adjust the error
> logging so we log the value that lead to the error, not some other
> value.
>
>
> Diffs
> -----
>
> src/slave/slave.cpp 74f6fb9036a9ac4f587f53ec2df04eeb4c167bfb
>
>
> Diff: https://reviews.apache.org/r/69157/diff/3/
>
>
> Testing
> -------
>
> `make check`
>
>
> Thanks,
>
> Benjamin Bannier
>
>
Re: Review Request 69157: Fixed handling for offer operation updates.
Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69157/
-----------------------------------------------------------
(Updated Nov. 13, 2018, 10:10 p.m.)
Review request for mesos, Chun-Hung Hsiao and Jan Schlicht.
Changes
-------
Fixed dependencies.
Bugs: MESOS-8403
https://issues.apache.org/jira/browse/MESOS-8403
Repository: mesos
Description
-------
The handling of offer operation updates introduced in `c946615ec6d`
made use of an update's `latest_status` without making sure that any
value was set. This could lead to situation where an uninitialized
enum value was switched on which would have caused a fatal error at
runtime.
This patch replaces uses of `latest_status` with `state` which does
contain the information we care about. We also adjust the error
logging so we log the value that lead to the error, not some other
value.
Diffs
-----
src/slave/slave.cpp 74f6fb9036a9ac4f587f53ec2df04eeb4c167bfb
Diff: https://reviews.apache.org/r/69157/diff/3/
Testing
-------
`make check`
Thanks,
Benjamin Bannier