[IOTDB-4358] set read consistency level to 'weak', quey SimpleFragmentParallelPlanner may exist out of bounds exception
set read consistency level to 'weak', quey SimpleFragmentParallelPlanner may exist out of bounds exception see: https://issues.apache.org/jira/browse/IOTDB-4358
Can we see the log like available replicas: before the exception occurs ?
Can we see the log like
available replicas:before the exception occurs ?
there 3 available datanode: java.lang.IndexOutOfBoundsException: Index: -2, Size: 3 (https://issues.apache.org/jira/browse/IOTDB-4358 exception info), I will find the detail log later. the reason of the issue is that the generated sessionId is negative , so [queryContext.getSession().getSessionId() % availableDataNodes.size()] is negative.
Can we see the log like
available replicas:before the exception occurs ?there 3 available datanode: java.lang.IndexOutOfBoundsException: Index: -2, Size: 3 (https://issues.apache.org/jira/browse/IOTDB-4358 exception info), I will find the detail log later. the reason of the issue is that the generated sessionId is negative , so [queryContext.getSession().getSessionId() % availableDataNodes.size()] is negative.
Yes, your analysis is correct. But...it is wired that we got an index -2 because the sessionId is always positive and the value of mod operation should be in [0, 2]. Why did we got a -2 here ? Thus I want to know the detailed log here
Can we see the log like
available replicas:before the exception occurs ?there 3 available datanode: java.lang.IndexOutOfBoundsException: Index: -2, Size: 3 (https://issues.apache.org/jira/browse/IOTDB-4358 exception info), I will find the detail log later. the reason of the issue is that the generated sessionId is negative , so [queryContext.getSession().getSessionId() % availableDataNodes.size()] is negative.
Yes, your analysis is correct. But...it is wired that we got an index
-2because the sessionId is always positive and the value of mod operation should be in [0, 2]. Why did we got a-2here ? Thus I want to know the detailed log here
The session ID cannot be automatically incremented. It should be secure random number . In the case of a secure random number, a negative number appears. We're using a secure random number.
Can we see the log like
available replicas:before the exception occurs ?there 3 available datanode: java.lang.IndexOutOfBoundsException: Index: -2, Size: 3 (https://issues.apache.org/jira/browse/IOTDB-4358 exception info), I will find the detail log later. the reason of the issue is that the generated sessionId is negative , so [queryContext.getSession().getSessionId() % availableDataNodes.size()] is negative.
Yes, your analysis is correct. But...it is wired that we got an index
-2because the sessionId is always positive and the value of mod operation should be in [0, 2]. Why did we got a-2here ? Thus I want to know the detailed log here
there is a sample code ` // if the current id is (Long.MAX_VALUE - 10)
AtomicLong ge = new AtomicLong(Long.MAX_VALUE - 10);
System.out.println(Long.MAX_VALUE);
long idd;
while (true) {
idd = ge.incrementAndGet();
if (idd < 0) {
System.out.println("idd < 0: " + idd);
break;
}
}
` the result is : idd < 0: -9223372036854775808 because of long type overflow