> On jún. 27, 2016, 5:36 du, Alejandro Fernandez wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java,
> >  line 288
> > <https://reviews.apache.org/r/49265/diff/1/?file=1431054#file1431054line288>
> >
> >     What's the root cause of more than 1k rows being returned?
> >     RU/EU?

The number of returned lines is irrelevant here. The problem is the number of 
parameters in the prepared statement. The query above has "task_id IN ?1" part 
and "?1" is replaced with a collection. If that collection has many elements, 
the prepared statement looks like "task_id IN 
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,...)". There is an upper limit for 
the number of parameters on the sql server side. This was handled for oracle 
only, but mssql has a limit as well, so it has no point to apply the logic only 
for oracle, rather now it is configurable.
The number of parameteres is high when stage summaries are being created and 
cache is empty (e.g.: because of an earlier host removal or an ambari server 
restart). That case all tasks are in the collection, so in the case of a 200 
nodes cluster the number of tasks can be over 2200. (mssql rejected the 
request, because the upper limit for number of parameteres in this case was 
2100)

What does "RU/EU" mean?


- Daniel


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


On jún. 27, 2016, 2:01 du, Daniel Gergely wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49265/
> -----------------------------------------------------------
> 
> (Updated jún. 27, 2016, 2:01 du)
> 
> 
> Review request for Ambari, Laszlo Puskas, Oliver Szabo, Sandor Magyari, Sumit 
> Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-17449
>     https://issues.apache.org/jira/browse/AMBARI-17449
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> In the case of a larger cluster, the number of host role commands can be high 
> (magnitude of thousands). Database servers usually have a limit on the number 
> of parameters, so reaching this limit causes a failure.
> Paging should be introduced to have only a smaller number of parameters in a 
> single query and do multiple queries to obtain the final result.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
>  2eb0734 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/DaoUtils.java 
> 7f157ec 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
>  1768f21 
> 
> Diff: https://reviews.apache.org/r/49265/diff/
> 
> 
> Testing
> -------
> 
> Running locally...
> 
> 
> Thanks,
> 
> Daniel Gergely
> 
>

Reply via email to