[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-24 Thread Ivan Pavlukhin (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16800030#comment-16800030
 ] 

Ivan Pavlukhin commented on IGNITE-11471:
-

[~ibelyakov], [~vozerov], please pay attention that line (from patch) in method 
{{JdbcThinTcpIo#nextServerIndex}}
{code}
return (int)(abs(nextIdx) % len);
{code}
can still return negative number because {{Math.abs}} returns 
{{Long.MIN_VALUE}} if {{Long.MIN_VALUE}} is passed as argument and {{%}} 
operators preserves a sign of a _dividend_ ({{-1 % 2 == -1}}).

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Assignee: Igor Belyakov
>Priority: Major
>  Labels: newbie
> Fix For: 2.8
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-20 Thread Igor Belyakov (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16797292#comment-16797292
 ] 

Igor Belyakov commented on IGNITE-11471:


[~vozerov], In current case RND changing has an effect, because @Before method 
in the test replaces IgniteUtils.RND instance before the first access to 
JdbcThinTcpIo. Therefore, JdbcThinTcpIo.IDX_GEN will be initialized by using 
updated IgniteUtils.RND.

Anyway, I agree that it's too tricky solution and exposing IgniteUtils.RND 
wasn't right.

I've reverted last commit.

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Assignee: Igor Belyakov
>Priority: Major
>  Labels: newbie
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-20 Thread Igor Belyakov (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16796905#comment-16796905
 ] 

Igor Belyakov commented on IGNITE-11471:


[~vozerov], random instance for IDX_GEN initialization has been changed to 
IgniteUtils.RND. Unit test added.

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Assignee: Igor Belyakov
>Priority: Major
>  Labels: newbie
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-20 Thread Ignite TC Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16796895#comment-16796895
 ] 

Ignite TC Bot commented on IGNITE-11471:


{panel:title=-- Run :: All: No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=3355627buildTypeId=IgniteTests24Java8_RunAll]

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Assignee: Igor Belyakov
>Priority: Major
>  Labels: newbie
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-13 Thread Ignite TC Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16791518#comment-16791518
 ] 

Ignite TC Bot commented on IGNITE-11471:


{panel:title=-- Run :: All: No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=3297736buildTypeId=IgniteTests24Java8_RunAll]

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Assignee: Igor Belyakov
>Priority: Major
>  Labels: newbie
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-13 Thread Ignite TC Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16791475#comment-16791475
 ] 

Ignite TC Bot commented on IGNITE-11471:


{panel:title=-- Run :: All: Possible 
Blockers|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}
{color:#d04437}Platform .NET (Long Running){color} [[tests 0 TIMEOUT 
|https://ci.ignite.apache.org/viewLog.html?buildId=3297710]]

{panel}
[TeamCity *-- Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=3297736buildTypeId=IgniteTests24Java8_RunAll]

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Assignee: Igor Belyakov
>Priority: Major
>  Labels: newbie
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-11471) JDBC: Thin driver should start with a random server to connect

2019-03-04 Thread Stanislav Lukyanov (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-11471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16783581#comment-16783581
 ] 

Stanislav Lukyanov commented on IGNITE-11471:
-

Choice of the server was random initially, but it was changed to a JVM-local 
round-robin in IGNITE-9704.

Need to use keep the `AtomicLong` for local round-robin, but initialize it with 
a random value instead of zero.

> JDBC: Thin driver should start with a random server to connect
> --
>
> Key: IGNITE-11471
> URL: https://issues.apache.org/jira/browse/IGNITE-11471
> Project: Ignite
>  Issue Type: Improvement
>  Components: jdbc
>Reporter: Stanislav Lukyanov
>Priority: Major
>  Labels: newbie
>
> Thin JDBC driver uses a list of server addresses to connect to. Connections 
> created in a single JVM will use round-robin to choose the server to connect, 
> yielding a uniform distribution. However, the round-robin always starts from 
> the first server in the list. It means that multiple JVMs with the same JDBC 
> connection URL and one connection each will all connect to the same server.
> Need to choose the first server randomly to have a better distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)