Amey Barve created GEODE-2211:
---------------------------------

             Summary: OQL query shows partial results when data is inserted 
through REST POST api.
                 Key: GEODE-2211
                 URL: https://issues.apache.org/jira/browse/GEODE-2211
             Project: Geode
          Issue Type: Bug
          Components: gfsh, querying, rest (dev)
            Reporter: Amey Barve
            Assignee: Mark Bretl

Steps to Reproduce the Issue
Start a locator
Configure pdx
Start server1 with Developer Rest Enabled.
Start server2
Create Geode Region PARTIONED_PERSISTENENT
Using Swagger UI enter some Key and Values in the Region.
using mash run query "Select * /Region"

Executing - query --query="Select * from /test"

Result     : true
startCount : 0
endCount   : 20
Rows       : 4

 1   |  3   |            deserializedForReading             |         
stringForm         | DSFID |  serializedValue   | sizeInBytes | serialized | 
valueSizeInBytes | value
---- | ---- | --------------------------------------------- | 
-------------------------- | ----- | ------------------ | ----------- | 
---------- | ---------------- | ------------------
A    | C    | org.apache.geode.pdx.internal.PdxInstanceImpl | 
PDX[2,__GEMFIRE_JSON]{2=B} | -65   | org.json.JSONArray | 37          | true    
   | 25               | org.json.JSONArray
null | null | org.apache.geode.pdx.internal.PdxInstanceImpl | 
PDX[4,__GEMFIRE_JSON]{4=D} | -65   | org.json.JSONArray | 37          | true    
   | 25               | org.json.JSONArray
null | null | null                                          | null              
         | null  | null               | null        | null       | null         
    | null
null | null | null                                          | null              
         | null  | null               | null        | null       | null         
    | null

NEXT_STEP_NAME : END

It only shows first 2 entries and other as null.

The below script reproduces the issue:

#!/usr/bin/env bash

GEODE_HOME=./geode-assembly/build/install/apache-geode

$GEODE_HOME/bin/gfsh -e "start locator --name=l1 --port=10339" \
-e "configure pdx --read-serialized=true --disk-store" \
-e "start server --name=s1 --server-port=40408 
--J=-Dgemfire.start-dev-rest-api=true --J=-Dgemfire.http-service-port=8080 
--J=-Dgemfire.http-service-bind-address=localhost" \
-e "start server --name=s2 --server-port=40409 " \
-e "create region --name=test --type=PARTITION_PERSISTENT"

tput setaf 3; echo "Inserting the values in persisten region test"
`curl -s -H 'Content-Type: application/json' -H 'Accept: application/json' -X 
POST -d '{"1":"A"}' http://localhost:8080/gemfire-api/v1/test?key=1`
`curl -s -H 'Content-Type: application/json' -H 'Accept: application/json' -X 
POST -d '{"2":"B"}' http://localhost:8080/gemfire-api/v1/test?key=2`
`curl -s -H 'Content-Type: application/json' -H 'Accept: application/json' -X 
POST -d '{"3":"C"}' http://localhost:8080/gemfire-api/v1/test?key=3`
`curl -s -H 'Content-Type: application/json' -H 'Accept: application/json' -X 
POST -d '{"4":"D"}' http://localhost:8080/gemfire-api/v1/test?key=4`

tput setaf 3; echo "The values inserted into the region test are as"
echo `curl -X GET http://localhost:8080/gemfire-api/v1/test?limit=50 
2>/dev/null`

$GEODE_HOME/bin/gfsh -e "connect --locator=localhost[10339]" \
                     -e "query --query=\"Select * from /test\"" 
                     -e "stop server --name=s1 " \
                     -e "stop server --name=s2 " \
                     -e "stop locator --name=l1 "





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to