BUG"Network error" on temp array update in scidb-15.7.0.9258


#1

Attempts to store to a temp array that is being used in the same expression fail with a puzzling error:

scidb@ubu0:~$ ( bn=rt100M; time iquery -aq “set no fetch ; create temp array $bn value:double [v=0:100000000,500000,0]; store(build($bn,random()),$bn) ; store(sort($bn,500000),$bn);” )
Query was executed successfully
Query was executed successfully
SystemException in file: src/network/NetworkManager.cpp function: abortQueryOnConnError line: 940
Error id: scidb::SCIDB_SE_NETWORK::SCIDB_LE_CONNECTION_ERROR2
Error description: Network error. Connection error while sending.

real 5m28.972s
user 0m0.040s
sys 0m0.056s

This error had me suspecting connectivity issues and trying all manner of changes for the configuration.

A work around is to output results into a different array:

( bn=rt100Mb; time iquery -aq “set no fetch ; create temp array $bn value:double [v=0:100000000,500000,0]; store(build($bn,random()),$bn) ; store(sort($bn,500000),${bn}b);” )
Query was executed successfully
Query was executed successfully
Query was executed successfully

real 5m56.624s
user 0m0.076s
sys 0m0.044s


#2

Hi Chris,

Thanks for the report and sorry about the inconvenience. I can reproduce the problem, we will file it and we’ll fix it.

By way of extra info, this appears to be a problem with array boundary constraints.
The temp array has schema value:double [v=0:100000000,500000,0]
The output of sort, by convention, has schema value:double [n=0:*,500000,0]

In this case, it is the upper bound that appears to be problematic - the storing of something ending with "" into something that ends at 100M. Looks like a bug there. Arguably this whole area could use some attention and I generally try to create arrays that are 0: unless I am specifically doing linear algebra.

By way of workarounds, these all work:

#1. Making the temp array unbounded (in which case the build needs a bounded schema):
$  ( bn=rt100M; time iquery -aq "set no fetch ; create temp array $bn <value:double> [v=0:*,500000,0]; store(build( <value:double> [v=0:100000000,500000,0],random()),$bn) ; store(sort($bn,500000),$bn);" )

#2. Using subarray to bound the sort output:
$  ( bn=rt100M; time iquery -aq "set no fetch ; create temp array $bn <value:double> [v=0:100000000,500000,0]; store(build($bn,random()),$bn) ; store(subarray(sort($bn,500000), 0, 100000000),$bn);" )

#3. Using redimension to bound the output:
( bn=rt100M; time iquery -aq "set no fetch ; create temp array $bn <value:double> [v=0:100000000,500000,0]; store(build($bn,random()),$bn) ; store(redimension(sort($bn,500000), <value:double> [n=0:100000000,500000,0] ),$bn);" )

Hope it helps. We’ll let you know when we have a fix.