You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Ajit Kumar <aj...@hortonworks.com> on 2016/02/09 01:57:45 UTC

Review Request 43349: Update Service only after successful persistance

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

Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.


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


Repository: ambari


Description
-------

If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 

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


Testing
-------

Unit tests


Thanks,

Ajit Kumar


Re: Review Request 43349: Update in memory service list only after successful persistance

Posted by Nahappan Somasundaram <ns...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43349/#review118491
-----------------------------------------------------------


Ship it!




Ship It!

- Nahappan Somasundaram


On Feb. 9, 2016, 8:18 a.m., Ajit Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43349/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2016, 8:18 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14965
>     https://issues.apache.org/jira/browse/AMBARI-14965
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 
> 
> Diff: https://reviews.apache.org/r/43349/diff/
> 
> 
> Testing
> -------
> 
> Unit test
> Tested APIs manually.
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>


Re: Review Request 43349: Update in memory service list only after successful persistance

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43349/#review118451
-----------------------------------------------------------


Ship it!




Ship It!

- Alejandro Fernandez


On Feb. 9, 2016, 4:18 p.m., Ajit Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43349/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2016, 4:18 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14965
>     https://issues.apache.org/jira/browse/AMBARI-14965
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 
> 
> Diff: https://reviews.apache.org/r/43349/diff/
> 
> 
> Testing
> -------
> 
> Unit test
> Tested APIs manually.
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>


Re: Review Request 43349: Update in memory service list only after successful persistance

Posted by Ajit Kumar <aj...@hortonworks.com>.

> On Feb. 9, 2016, 7:48 p.m., Nahappan Somasundaram wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java, line 462
> > <https://reviews.apache.org/r/43349/diff/1/?file=1237958#file1237958line462>
> >
> >     This seems to be the only change required! The rest of the changes are refactoring and fixing syntax sugar. :-)
> >     
> >     It took me a while to identify the actual fix. Which is why it is always good to leave out the noise.

Yes, that is correct :). I took me quite some time to read through every line of code to figure out what is going on. This is the reason, I just moved whole chunk to a separate method which makes reading code is much easier. Filing a jira for this would be overkill.


- Ajit


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


On Feb. 9, 2016, 4:18 p.m., Ajit Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43349/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2016, 4:18 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14965
>     https://issues.apache.org/jira/browse/AMBARI-14965
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 
> 
> Diff: https://reviews.apache.org/r/43349/diff/
> 
> 
> Testing
> -------
> 
> Unit test
> Tested APIs manually.
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>


Re: Review Request 43349: Update in memory service list only after successful persistance

Posted by Nahappan Somasundaram <ns...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43349/#review118450
-----------------------------------------------------------




ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java (line 358)
<https://reviews.apache.org/r/43349/#comment179680>

    This seems to be the only change required! The rest of the changes are refactoring and fixing syntax sugar. :-)
    
    It took me a while to identify the actual fix. Which is why it is always good to leave out the noise.


- Nahappan Somasundaram


On Feb. 9, 2016, 8:18 a.m., Ajit Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43349/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2016, 8:18 a.m.)
> 
> 
> Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14965
>     https://issues.apache.org/jira/browse/AMBARI-14965
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 
> 
> Diff: https://reviews.apache.org/r/43349/diff/
> 
> 
> Testing
> -------
> 
> Unit test
> Tested APIs manually.
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>


Re: Review Request 43349: Update in memory service list only after successful persistance

Posted by Jayush Luniya <jl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43349/#review118472
-----------------------------------------------------------


Ship it!




Ship It!

- Jayush Luniya


On Feb. 9, 2016, 4:18 p.m., Ajit Kumar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43349/
> -----------------------------------------------------------
> 
> (Updated Feb. 9, 2016, 4:18 p.m.)
> 
> 
> Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-14965
>     https://issues.apache.org/jira/browse/AMBARI-14965
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 
> 
> Diff: https://reviews.apache.org/r/43349/diff/
> 
> 
> Testing
> -------
> 
> Unit test
> Tested APIs manually.
> 
> 
> Thanks,
> 
> Ajit Kumar
> 
>


Re: Review Request 43349: Update in memory service list only after successful persistance

Posted by Ajit Kumar <aj...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43349/
-----------------------------------------------------------

(Updated Feb. 9, 2016, 4:18 p.m.)


Review request for Ambari, Jayush Luniya, Nahappan Somasundaram, and Sumit Mohanty.


Summary (updated)
-----------------

Update in memory service list only after successful persistance


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


Repository: ambari


Description
-------

If post request of service creation fails due to db error, Get request shows service is created. If you send post request again, it fails stating service already exists though DB doesn't have any corresponding entry.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java a2aca7071af661f9903c11121572ec5b110b3826 

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


Testing (updated)
-------

Unit test
Tested APIs manually.


Thanks,

Ajit Kumar