[infinispan-issues] [JBoss JIRA] (HRJS-3) Iterator doesn't work properly on cluster

Galder Zamarreño (JIRA) issues at jboss.org
Thu Apr 21 10:10:00 EDT 2016


     [ https://issues.jboss.org/browse/HRJS-3?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Galder Zamarreño resolved HRJS-3.
---------------------------------
    Resolution: Done


> Iterator doesn't work properly on cluster
> -----------------------------------------
>
>                 Key: HRJS-3
>                 URL: https://issues.jboss.org/browse/HRJS-3
>             Project: Infinispan Javascript client
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Galder Zamarreño
>            Assignee: Galder Zamarreño
>             Fix For: 0.3.0
>
>
> While porting the tests for local mode also to cluster mode, I have faced the following issue: 
> When calling iterator on client connected to one of the nodes of 3 node cluster, the result of iteration is not correct. 
> You can find the test [here|https://github.com/andyuk1986/js-client/blob/ISPN-6381/spec/infinispan_cluster_spec.js#L394]. 
> The test run returns the following result: 
> {code}
> 1) Infinispan cluster client can iterate over entries using different clients
>    Message:
>      Expected { done : true, key : 'it2', value : 'v2' } to equal <jasmine.objectContaining({ key : 'it1', value : 'v1', done : false })>.
>    Stacktrace:
>      Error: Expected { done : true, key : 'it2', value : 'v2' } to equal <jasmine.objectContaining({ key : 'it1', value : 'v1', done : false })>.
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:208:43
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:413:39
>     at Function._.map._.collect (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/underscore/underscore.js:172:24)
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:409:7
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:362:43
>     at tryCallOne (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/lib/core.js:37:12)
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/lib/core.js:123:15
>     at flush (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/node_modules/asap/raw.js:50:29)
>   2) Infinispan cluster client can iterate over entries using different clients
>    Message:
>      Expected { done : true } to equal <jasmine.objectContaining({ key : 'it2', value : 'v2', done : false })>.
>    Stacktrace:
>      Error: Expected { done : true } to equal <jasmine.objectContaining({ key : 'it2', value : 'v2', done : false })>.
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:208:43
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:413:39
>     at Function._.map._.collect (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/underscore/underscore.js:172:24)
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:409:7
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:362:43
>     at tryCallOne (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/lib/core.js:37:12)
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/lib/core.js:123:15
>     at flush (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/node_modules/asap/raw.js:50:29)
>   3) Infinispan cluster client can iterate over entries using different clients
>    Message:
>      Expected { done : true } to equal <jasmine.objectContaining({ key : 'it3', value : 'v3', done : false })>.
>    Stacktrace:
>      Error: Expected { done : true } to equal <jasmine.objectContaining({ key : 'it3', value : 'v3', done : false })>.
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:208:43
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:413:39
>     at Function._.map._.collect (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/underscore/underscore.js:172:24)
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:409:7
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/spec/utils/testing.js:362:43
>     at tryCallOne (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/lib/core.js:37:12)
>     at /home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/lib/core.js:123:15
>     at flush (/home/amanukya/Documents/Red Hat Workspace/js-client/node_modules/promise/node_modules/asap/raw.js:50:29)
> {code}
> In other words, the result of the iteration is: 
> [{"done":true,"key":"it2","value":"v2"}, {"done":true}, {"done":true}]
> Another example is, when I am trying out the example for iterations given in the [README.md file|https://github.com/infinispan/js-client/blob/master/README.md#working-with-multiple-entries], with only difference that the server to which the client connects is a node from the cluster, the iteration returns no result. The following log is printed out for it: 
> {code}
> [2016-04-07 16:34:05.186] [DEBUG] client - Invoke iterator(msgId=4,batchSize=1,opts=undefined)
> [2016-04-07 16:34:05.186] [TRACE] encoder - Encode operation with topology id 4
> [2016-04-07 16:34:05.187] [TRACE] transport - Write buffer(msgId=4) to 127.0.0.1:11422
> [2016-04-07 16:34:05.190] [TRACE] decoder - Read header(msgId=4): opCode=50, status=0, hasNewTopology=0
> [2016-04-07 16:34:05.190] [TRACE] decoder - Call decode for request(msgId=4)
> [2016-04-07 16:34:05.190] [TRACE] connection - After decoding request(msgId=4), buffer size is 42, and offset 42
> [2016-04-07 16:34:05.190] [TRACE] connection - Complete success for request(msgId=4) with df2ccfcc-1aad-492e-bfad-95e45854d9d4
> [2016-04-07 16:34:05.190] [TRACE] client - Invoke iterator.next(msgId=5,iteratorId=df2ccfcc-1aad-492e-bfad-95e45854d9d4)
> [2016-04-07 16:34:05.191] [TRACE] encoder - Encode operation with topology id 4
> [2016-04-07 16:34:05.191] [TRACE] transport - Write buffer(msgId=5) to 127.0.0.1:11322
> [2016-04-07 16:34:05.191] [TRACE] decoder - Read header(msgId=5): opCode=52, status=5, hasNewTopology=0
> [2016-04-07 16:34:05.192] [TRACE] decoder - Call decode for request(msgId=5)
> [2016-04-07 16:34:05.192] [TRACE] iterator - Iterator next contains 0 entries
> [2016-04-07 16:34:05.192] [TRACE] connection - After decoding request(msgId=5), buffer size is 7, and offset 7
> [2016-04-07 16:34:05.192] [TRACE] connection - Complete success for request(msgId=5) with []
> iterator.next()={"done":true}
> {code}
> If I am doing something wrong, please let me know. I couldn't find any solution for it. 



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the infinispan-issues mailing list