Issue with multiple shards and parent / child Edit


(benjamin.roth) #1

Hi,

I've nested documents, everything is fine in dev since I've only one shard,
but in production it fails with the following message:

{"error"=>"RoutingMissingException[routing is required for [users]/[timeline_post]/[1]]", "status"=>500}

The logged query is:

curl -X POST "http://foo.qbox.io/users/timeline_post/1?parent=23" -d '{"id":1,"body":"foo"}'

I thought there were no need to specify routing if the parent is provided.

Any idea what's wrong here please?

Thanks,

Ben

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #2

Hey,

can you share more information about your sample (also I am not sure if
qbox is doing anything special though). Your mapping would be especially
interesting. Also, does this problem occur in your dev setup as well, if
you have several shards?

In addition: If you specify a parent, and no routing is specified, the
parent is used for routing. You can try to set parent and routing and try
if this changes anything in your setup.

--Alex

On Fri, Oct 4, 2013 at 11:07 PM, benjamin.roth@peachyweb.com wrote:

Hi,

I've nested documents, everything is fine in dev since I've only one
shard, but in production it fails with the following message:

{"error"=>"RoutingMissingException[routing is required for [users]/[timeline_post]/[1]]", "status"=>500}

The logged query is:

curl -X POST "http://foo.qbox.io/users/timeline_post/1?parent=23" -d '{"id":1,"body":"foo"}'

I thought there were no need to specify routing if the parent is provided.

Any idea what's wrong here please?

Thanks,

Ben

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(benjamin.roth) #3

Hi Alex,

Thanks for your interest in my question.
Everything works fine in dev env but I have only one shard. Will try to use
explicit routing.

In the meantime, here are my indexes:

http://foo.qbox.io/users/user/_mapping

{

  • user:
    {
    • properties:
      {
      • id:
        {
        • type: "integer"
          },
      • name:
        {
        • type: "string",
        • analyzer: "snowball"
          },
      • lat_lon:
        {
        • type: "geo_point"
          }
          }
          }

}

http:/foo.qbox.io/users/timeline_post/_mapping

{

  • timeline_post:
    {
    • _parent:
      {
      • type: "user"
        },
    • _routing:
      {
      • required: true
        },
    • properties:
      {
      • body:
        {
        • type: "string",
        • analyzer: "snowball"
          },
      • id:
        {
        • type: "integer"
          }
          }
          }

}

On Sunday, October 6, 2013 7:26:26 PM UTC+2, Alexander Reelsen wrote:

Hey,

can you share more information about your sample (also I am not sure if
qbox is doing anything special though). Your mapping would be especially
interesting. Also, does this problem occur in your dev setup as well, if
you have several shards?

In addition: If you specify a parent, and no routing is specified, the
parent is used for routing. You can try to set parent and routing and try
if this changes anything in your setup.

--Alex

On Fri, Oct 4, 2013 at 11:07 PM, <benjam...@peachyweb.com <javascript:>>wrote:

Hi,

I've nested documents, everything is fine in dev since I've only one
shard, but in production it fails with the following message:

{"error"=>"RoutingMissingException[routing is required for [users]/[timeline_post]/[1]]", "status"=>500}

The logged query is:

curl -X POST "http://foo.qbox.io/users/timeline_post/1?parent=23" -d '{"id":1,"body":"foo"}'

I thought there were no need to specify routing if the parent is provided.

Any idea what's wrong here please?

Thanks,

Ben

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #4

Hey,

it is not a single shard problem. You can easily fire up your elasticsearch
instance and create an index with 10 shards, and use the parent parameter
like this:

curl -X DELETE localhost:9200/test/
curl -X PUT localhost:9200/test/ -d '{ "settings" : {
"index.number_of_shards" : 10 } }'

curl -X PUT localhost:9200/test/user/_mapping -d '{
"user": {
"properties": {
"id": { "type": "integer" },
"name": { "type": "string", "analyzer": "snowball" },
"lat_lon": { "type": "geo_point" }
}
}
}'

curl -X PUT localhost:9200/test/timeline_post/_mapping -d '{
"timeline_post": {
"_parent": { "type": "user" },
"_routing": { "required": true },
"properties": {
"body": { "type": "string", "analyzer": "snowball" },
"id": { "type": "integer" }
}
}
}'

curl -X PUT 'localhost:9200/test/timeline_post/1?parent=12' -d '{
"foo":"bar" }'

So, maybe I have done something different to your problem or maybe want to
ask the company running the hosted search if there is something special we
dont cater for here.

--Alex

On Sun, Oct 6, 2013 at 7:54 PM, benjamin.roth@peachyweb.com wrote:

Hi Alex,

Thanks for your interest in my question.
Everything works fine in dev env but I have only one shard. Will try to
use explicit routing.

In the meantime, here are my indexes:

http://foo.qbox.io/users/user/_mapping

{

  • user:
    {
    • properties:
      {
      • id:
        {
        • type: "integer"
          },
      • name:
        {
        • type: "string",
        • analyzer: "snowball"
          },
      • lat_lon:
        {
        • type: "geo_point"
          }
          }
          }

}

http:/foo.qbox.io/users/timeline_post/_mapping

{

  • timeline_post:
    {
    • _parent:
      {
      • type: "user"
        },
    • _routing:
      {
      • required: true
        },
    • properties:
      {
      • body:
        {
        • type: "string",
        • analyzer: "snowball"
          },
      • id:
        {
        • type: "integer"
          }
          }
          }

}

On Sunday, October 6, 2013 7:26:26 PM UTC+2, Alexander Reelsen wrote:

Hey,

can you share more information about your sample (also I am not sure if
qbox is doing anything special though). Your mapping would be especially
interesting. Also, does this problem occur in your dev setup as well, if
you have several shards?

In addition: If you specify a parent, and no routing is specified, the
parent is used for routing. You can try to set parent and routing and try
if this changes anything in your setup.

--Alex

On Fri, Oct 4, 2013 at 11:07 PM, benjam...@peachyweb.com wrote:

Hi,

I've nested documents, everything is fine in dev since I've only one
shard, but in production it fails with the following message:

{"error"=>"**RoutingMissingException[**routing is required for [users]/[timeline_post]/[1]]", "status"=>500}

The logged query is:

curl -X POST "http://foo.qbox.io/users/**timeline_post/1?parent=23 http://foo.qbox.io/users/timeline_post/1?parent=23" -d '{"id":1,"body":"foo"}'

I thought there were no need to specify routing if the parent is
provided.

Any idea what's wrong here please?

Thanks,

Ben

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(benjamin.roth) #5

Thanks to your expertise, I've contacted qbox support and it was an issue
on their side. They are working on it now.

Thanks Alexander!

On Sunday, October 6, 2013 10:32:38 PM UTC+2, Alexander Reelsen wrote:

Hey,

it is not a single shard problem. You can easily fire up your
elasticsearch instance and create an index with 10 shards, and use the
parent parameter like this:

curl -X DELETE localhost:9200/test/
curl -X PUT localhost:9200/test/ -d '{ "settings" : {
"index.number_of_shards" : 10 } }'

curl -X PUT localhost:9200/test/user/_mapping -d '{
"user": {
"properties": {
"id": { "type": "integer" },
"name": { "type": "string", "analyzer": "snowball" },
"lat_lon": { "type": "geo_point" }
}
}
}'

curl -X PUT localhost:9200/test/timeline_post/_mapping -d '{
"timeline_post": {
"_parent": { "type": "user" },
"_routing": { "required": true },
"properties": {
"body": { "type": "string", "analyzer": "snowball" },
"id": { "type": "integer" }
}
}
}'

curl -X PUT 'localhost:9200/test/timeline_post/1?parent=12' -d '{
"foo":"bar" }'

So, maybe I have done something different to your problem or maybe want to
ask the company running the hosted search if there is something special we
dont cater for here.

--Alex

On Sun, Oct 6, 2013 at 7:54 PM, <benjam...@peachyweb.com <javascript:>>wrote:

Hi Alex,

Thanks for your interest in my question.
Everything works fine in dev env but I have only one shard. Will try to
use explicit routing.

In the meantime, here are my indexes:

http://foo.qbox.io/users/user/_mapping

{

  • user:
    {
    • properties:
      {
      • id:
        {
        • type: "integer"
          },
      • name:
        {
        • type: "string",
        • analyzer: "snowball"
          },
      • lat_lon:
        {
        • type: "geo_point"
          }
          }
          }

}

http:/foo.qbox.io/users/timeline_post/_mapping

{

  • timeline_post:
    {
    • _parent:
      {
      • type: "user"
        },
    • _routing:
      {
      • required: true
        },
    • properties:
      {
      • body:
        {
        • type: "string",
        • analyzer: "snowball"
          },
      • id:
        {
        • type: "integer"
          }
          }
          }

}

On Sunday, October 6, 2013 7:26:26 PM UTC+2, Alexander Reelsen wrote:

Hey,

can you share more information about your sample (also I am not sure if
qbox is doing anything special though). Your mapping would be especially
interesting. Also, does this problem occur in your dev setup as well, if
you have several shards?

In addition: If you specify a parent, and no routing is specified, the
parent is used for routing. You can try to set parent and routing and try
if this changes anything in your setup.

--Alex

On Fri, Oct 4, 2013 at 11:07 PM, benjam...@peachyweb.com wrote:

Hi,

I've nested documents, everything is fine in dev since I've only one
shard, but in production it fails with the following message:

{"error"=>"**RoutingMissingException[**routing is required for [users]/[timeline_post]/[1]]", "status"=>500}

The logged query is:

curl -X POST "http://foo.qbox.io/users/**timeline_post/1?parent=23 http://foo.qbox.io/users/timeline_post/1?parent=23" -d '{"id":1,"body":"foo"}'

I thought there were no need to specify routing if the parent is
provided.

Any idea what's wrong here please?

Thanks,

Ben

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@**googlegroups.com.

For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #6