Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-08 Thread Laszlo Puskas

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/
---

(Updated Aug. 8, 2016, 11:43 a.m.)


Review request for Ambari, Jonathan Hurley, Robert Nettleton, Sandor Magyari, 
and Sebastian Toader.


Bugs: AMBARI-18005
https://issues.apache.org/jira/browse/AMBARI-18005


Repository: ambari


Description
---

When a host is removed from the cluster and later from ambari there's a chance 
the agent registers back to the ambari server before the agent is stopped.
Stopping the machine running the agent without the host being deleted again 
leads to an inconsistent state in the ambari-server due to cached state.
Resolution:
The cached resources get cleared on host delete event.


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 9a6ee94 

Diff: https://reviews.apache.org/r/50753/diff/


Testing
---

Suceesfully tested. (Manually)
Unit tests OK


Thanks,

Laszlo Puskas



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-08 Thread Laszlo Puskas

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/
---

(Updated Aug. 8, 2016, 11:31 a.m.)


Review request for Ambari, Jonathan Hurley, Robert Nettleton, Sandor Magyari, 
and Sebastian Toader.


Changes
---

Fixed NPE prone code


Bugs: AMBARI-18005
https://issues.apache.org/jira/browse/AMBARI-18005


Repository: ambari


Description
---

When a host is removed from the cluster and later from ambari there's a chance 
the agent registers back to the ambari server before the agent is stopped.
Stopping the machine running the agent without the host being deleted again 
leads to an inconsistent state in the ambari-server due to cached state.
Resolution:
The cached resources get cleared on host delete event.


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 9a6ee94 

Diff: https://reviews.apache.org/r/50753/diff/


Testing
---

Suceesfully tested. (Manually)
Unit tests OK


Thanks,

Laszlo Puskas



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-05 Thread Laszlo Puskas

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/
---

(Updated Aug. 5, 2016, 2:39 p.m.)


Review request for Ambari, Jonathan Hurley, Robert Nettleton, Sandor Magyari, 
and Sebastian Toader.


Bugs: AMBARI-18005
https://issues.apache.org/jira/browse/AMBARI-18005


Repository: ambari


Description
---

When a host is removed from the cluster and later from ambari there's a chance 
the agent registers back to the ambari server before the agent is stopped.
Stopping the machine running the agent without the host being deleted again 
leads to an inconsistent state in the ambari-server due to cached state.
Resolution:
The cached resources get cleared on host delete event.


Diffs
-

  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
a757010 
  
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 0190478 

Diff: https://reviews.apache.org/r/50753/diff/


Testing (updated)
---

Suceesfully tested. (Manually)
Unit tests OK


Thanks,

Laszlo Puskas



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-05 Thread Laszlo Puskas


> On Aug. 5, 2016, 12:36 p.m., Jonathan Hurley wrote:
> > This is an AmbariEvent which has it's own EventBus; however the bus is an 
> > asynchronous, single-threaded bus. This means that it's possible for a 
> > heartbeat to be received in between when this event is broadcast and when 
> > it's received by your subscriber method. 
> > 
> > If the problem only happens on registration, I think this solution is OK. 
> > But if a heartbeat from an agent can cause problems as well, then there is 
> > still a slight chance that the timing here could still reproduce the bug.
> 
> Laszlo Puskas wrote:
> Thanks for the observation. The problem only occurred on registration; 
> Even if the host is registered before the host remove event is processed, the 
> registering host will have a new id, thus the removal won't interfere with 
> the new method.

In my previous comment i erroneously stated, that the new method won't cause 
issues due to the new id the host will be assigned when it registers back.
Actually the code will behave correctly because available hosts are stored in a 
list; thus the code will find the proper record to remove. (the older entry 
will be found first in the list)


- Laszlo


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/#review144920
---


On Aug. 4, 2016, 3:22 p.m., Laszlo Puskas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50753/
> ---
> 
> (Updated Aug. 4, 2016, 3:22 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Robert Nettleton, Sandor Magyari, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18005
> https://issues.apache.org/jira/browse/AMBARI-18005
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When a host is removed from the cluster and later from ambari there's a 
> chance the agent registers back to the ambari server before the agent is 
> stopped.
> Stopping the machine running the agent without the host being deleted again 
> leads to an inconsistent state in the ambari-server due to cached state.
> Resolution:
> The cached resources get cleared on host delete event.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> a757010 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
>  0190478 
> 
> Diff: https://reviews.apache.org/r/50753/diff/
> 
> 
> Testing
> ---
> 
> Suceesfully tested. (Manually)
> Unit tests in progress.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-05 Thread Laszlo Puskas


> On Aug. 5, 2016, 12:36 p.m., Jonathan Hurley wrote:
> > This is an AmbariEvent which has it's own EventBus; however the bus is an 
> > asynchronous, single-threaded bus. This means that it's possible for a 
> > heartbeat to be received in between when this event is broadcast and when 
> > it's received by your subscriber method. 
> > 
> > If the problem only happens on registration, I think this solution is OK. 
> > But if a heartbeat from an agent can cause problems as well, then there is 
> > still a slight chance that the timing here could still reproduce the bug.

Thanks for the observation. The problem only occurred on registration; Even if 
the host is registered before the host remove event is processed, the 
registering host will have a new id, thus the removal won't interfere with the 
new method.


- Laszlo


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/#review144920
---


On Aug. 4, 2016, 3:22 p.m., Laszlo Puskas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50753/
> ---
> 
> (Updated Aug. 4, 2016, 3:22 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Robert Nettleton, Sandor Magyari, 
> and Sebastian Toader.
> 
> 
> Bugs: AMBARI-18005
> https://issues.apache.org/jira/browse/AMBARI-18005
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When a host is removed from the cluster and later from ambari there's a 
> chance the agent registers back to the ambari server before the agent is 
> stopped.
> Stopping the machine running the agent without the host being deleted again 
> leads to an inconsistent state in the ambari-server due to cached state.
> Resolution:
> The cached resources get cleared on host delete event.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> a757010 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
>  0190478 
> 
> Diff: https://reviews.apache.org/r/50753/diff/
> 
> 
> Testing
> ---
> 
> Suceesfully tested. (Manually)
> Unit tests in progress.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-04 Thread Laszlo Puskas

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/
---

(Updated Aug. 4, 2016, 3:11 p.m.)


Review request for Ambari, Robert Nettleton, Sandor Magyari, and Sebastian 
Toader.


Changes
---

Manual test succeeded.


Bugs: AMBARI-18005
https://issues.apache.org/jira/browse/AMBARI-18005


Repository: ambari


Description
---

When a host is removed from the cluster and later from ambari there's a chance 
the agent registers back to the ambari server before the agent is stopped.
Stopping the machine running the agent without the host being deleted again 
leads to an inconsistent state in the ambari-server due to cached state.
Resolution:
The cached resources get cleared on host delete event.


Diffs
-

  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
a757010 
  
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 0190478 

Diff: https://reviews.apache.org/r/50753/diff/


Testing (updated)
---

Suceesfully tested. (Manually)
Unit tests in progress.


Thanks,

Laszlo Puskas



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-03 Thread Sandor Magyari

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/#review144619
---


Ship it!




Ship It!

- Sandor Magyari


On Aug. 3, 2016, 3:17 p.m., Laszlo Puskas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50753/
> ---
> 
> (Updated Aug. 3, 2016, 3:17 p.m.)
> 
> 
> Review request for Ambari, Robert Nettleton, Sandor Magyari, and Sebastian 
> Toader.
> 
> 
> Bugs: AMBARI-18005
> https://issues.apache.org/jira/browse/AMBARI-18005
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When a host is removed from the cluster and later from ambari there's a 
> chance the agent registers back to the ambari server before the agent is 
> stopped.
> Stopping the machine running the agent without the host being deleted again 
> leads to an inconsistent state in the ambari-server due to cached state.
> Resolution:
> The cached resources get cleared on host delete event.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> a757010 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
>  0190478 
> 
> Diff: https://reviews.apache.org/r/50753/diff/
> 
> 
> Testing
> ---
> 
> Manually, in progress.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-03 Thread Laszlo Puskas

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/
---

(Updated Aug. 3, 2016, 3:17 p.m.)


Review request for Ambari, Robert Nettleton, Sandor Magyari, and Sebastian 
Toader.


Changes
---

Applied review notes.


Bugs: AMBARI-18005
https://issues.apache.org/jira/browse/AMBARI-18005


Repository: ambari


Description
---

When a host is removed from the cluster and later from ambari there's a chance 
the agent registers back to the ambari server before the agent is stopped.
Stopping the machine running the agent without the host being deleted again 
leads to an inconsistent state in the ambari-server due to cached state.
Resolution:
The cached resources get cleared on host delete event.


Diffs (updated)
-

  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
a757010 
  
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 0190478 

Diff: https://reviews.apache.org/r/50753/diff/


Testing
---

Manually, in progress.


Thanks,

Laszlo Puskas



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-03 Thread Robert Nettleton

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/#review144618
---


Ship it!




Ship It!

- Robert Nettleton


On Aug. 3, 2016, 2:47 p.m., Laszlo Puskas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50753/
> ---
> 
> (Updated Aug. 3, 2016, 2:47 p.m.)
> 
> 
> Review request for Ambari, Robert Nettleton, Sandor Magyari, and Sebastian 
> Toader.
> 
> 
> Bugs: AMBARI-18005
> https://issues.apache.org/jira/browse/AMBARI-18005
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When a host is removed from the cluster and later from ambari there's a 
> chance the agent registers back to the ambari server before the agent is 
> stopped.
> Stopping the machine running the agent without the host being deleted again 
> leads to an inconsistent state in the ambari-server due to cached state.
> Resolution:
> The cached resources get cleared on host delete event.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> a757010 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
>  0190478 
> 
> Diff: https://reviews.apache.org/r/50753/diff/
> 
> 
> Testing
> ---
> 
> Manually, in progress.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>



Re: Review Request 50753: Cleared cached resources from ambari-server on host removal

2016-08-03 Thread Sebastian Toader

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50753/#review144617
---


Fix it, then Ship it!





ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 (line 974)


add some javadoc



ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 (line 990)


Let's make the message more explicit that the host is removed from 
available hosts.


- Sebastian Toader


On Aug. 3, 2016, 4:47 p.m., Laszlo Puskas wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50753/
> ---
> 
> (Updated Aug. 3, 2016, 4:47 p.m.)
> 
> 
> Review request for Ambari, Robert Nettleton, Sandor Magyari, and Sebastian 
> Toader.
> 
> 
> Bugs: AMBARI-18005
> https://issues.apache.org/jira/browse/AMBARI-18005
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> When a host is removed from the cluster and later from ambari there's a 
> chance the agent registers back to the ambari server before the agent is 
> stopped.
> Stopping the machine running the agent without the host being deleted again 
> leads to an inconsistent state in the ambari-server due to cached state.
> Resolution:
> The cached resources get cleared on host delete event.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java 
> a757010 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
>  0190478 
> 
> Diff: https://reviews.apache.org/r/50753/diff/
> 
> 
> Testing
> ---
> 
> Manually, in progress.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>