[
https://issues.apache.org/jira/browse/GEODE-2211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15799110#comment-15799110
]
Bruce Schuchardt commented on GEODE-2211:
-----------------------------------------
[~abarve] Many thanks for the great script to reproduce this problem.
The problem seems to be in the GFSH function that is processing query results.
It is getting a mix of PdxInstance objects for entries in one server and
PreferBytesCachedDeserializable wrappers from the other. It isn't handling the
latter correctly and that's why the query results didn't include correct
results for two of the entries.
In DataCommandFunction I added a check for CachedDeserializables in the
function and used getDeserializedForReading to get the PdxInstance.
{code}
if (results instanceof SelectResults) {
SelectResults selectResults = (SelectResults) results;
for (Iterator iter = selectResults.iterator(); iter.hasNext();) {
Object object = iter.next();
if (object instanceof CachedDeserializable) {
object =
((CachedDeserializable)object).getDeserializedForReading();
}
{code}
with that change the GFSH formatter is still confused though. Each document
has a different type and GFSH seems to be expecting homogeneous types. I ended
up with one row having all of the entries in it and the rest being null.
That's seen somewhat in the original output of this ticket, too, but it's hard
to discern because of the other problem:
{noformat}
1 | 2 | 3 | 4
---- | ---- | ---- | ----
A | B | C | D
null | null | null | null
null | null | null | null
null | null | null | null
{noformat}
If I change the numbers in the documents to be a field name so they're all the
same type of document it works fine. Here I changed them all to be the field
name "value" ({"value":"A"}, {"value":"B"} etc):
{noformat}
value
-----
C
A
B
D
{noformat}
> 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
>
> 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)