Seeing many new exceptions in latest master build


(Samuel Doyle) #1

I'm many exceptions I have encountered previously, here is one to start
with.

When I attempt to do a batch index, I delete the old index and recreate it.
I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I would
get an exception if it didn't exist, now even not even specifying the name I
get the exception, I need to make sure the index exists before continuing
but this makes it impossible since the check itself throws the exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Shay Banon) #2

Not sure I understand exactly what you do and when you get an exception, can
you explain it a bit better? A few questions, how do you get a Client
instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle samueldoyle@gmail.comwrote:

I'm many exceptions I have encountered previously, here is one to start
with.

When I attempt to do a batch index, I delete the old index and recreate it.
I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I would
get an exception if it didn't exist, now even not even specifying the name I
get the exception, I need to make sure the index exists before continuing
but this makes it impossible since the check itself throws the exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Samuel Doyle) #3

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I encountered
    problems before where I would attempt to index but the index was not yet
    available/created and would throw the exception so I put this check in.
    My first attempt to check would include the index name in the status request
    but that to would throw an exception, so I just do the request without any
    name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Not sure I understand exactly what you do and when you get an exception,
can you explain it a bit better? A few questions, how do you get a Client
instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle samueldoyle@gmail.comwrote:

I'm many exceptions I have encountered previously, here is one to start
with.

When I attempt to do a batch index, I delete the old index and recreate
it. I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I would
get an exception if it didn't exist, now even not even specifying the name I
get the exception, I need to make sure the index exists before continuing
but this makes it impossible since the check itself throws the exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Shay Banon) #4

This might be because the index was created, but shards have not been
allocated to it yet. What you can do is use the cluster health API, here is
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I encountered
    problems before where I would attempt to index but the index was not yet
    available/created and would throw the exception so I put this check in.
    My first attempt to check would include the index name in the status
    request but that to would throw an exception, so I just do the request
    without any name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Not sure I understand exactly what you do and when you get an exception,
can you explain it a bit better? A few questions, how do you get a Client
instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle samueldoyle@gmail.comwrote:

I'm many exceptions I have encountered previously, here is one to start
with.

When I attempt to do a batch index, I delete the old index and recreate
it. I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I would
get an exception if it didn't exist, now even not even specifying the name I
get the exception, I need to make sure the index exists before continuing
but this makes it impossible since the check itself throws the exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Samuel Doyle) #5

Ok great, I'll give that a try, thanks.

On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon shay.banon@elasticsearch.comwrote:

This might be because the index was created, but shards have not been
allocated to it yet. What you can do is use the cluster health API, here is
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I encountered
    problems before where I would attempt to index but the index was not yet
    available/created and would throw the exception so I put this check in.
    My first attempt to check would include the index name in the status
    request but that to would throw an exception, so I just do the request
    without any name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon <shay.banon@elasticsearch.com

wrote:

Not sure I understand exactly what you do and when you get an exception,
can you explain it a bit better? A few questions, how do you get a Client
instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle samueldoyle@gmail.comwrote:

I'm many exceptions I have encountered previously, here is one to start
with.

When I attempt to do a batch index, I delete the old index and recreate
it. I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I
would get an exception if it didn't exist, now even not even specifying the
name I get the exception, I need to make sure the index exists before
continuing but this makes it impossible since the check itself throws the
exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Shay Banon) #6

Let me just explain what it does, it will wait for 30 seconds (the default
timeout value) for the cluster to be in yellow state, which means at least
one shard per shard replica set has been allocated to a node.

-shay.banon

On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle samueldoyle@gmail.com wrote:

Ok great, I'll give that a try, thanks.

On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon shay.banon@elasticsearch.comwrote:

This might be because the index was created, but shards have not been
allocated to it yet. What you can do is use the cluster health API, here is
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I encountered
    problems before where I would attempt to index but the index was not yet
    available/created and would throw the exception so I put this check in.
    My first attempt to check would include the index name in the status
    request but that to would throw an exception, so I just do the request
    without any name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

Not sure I understand exactly what you do and when you get an exception,
can you explain it a bit better? A few questions, how do you get a Client
instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle samueldoyle@gmail.comwrote:

I'm many exceptions I have encountered previously, here is one to start
with.

When I attempt to do a batch index, I delete the old index and recreate
it. I then will check several times to see if the index exists using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I
would get an exception if it didn't exist, now even not even specifying the
name I get the exception, I need to make sure the index exists before
continuing but this makes it impossible since the check itself throws the
exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Samuel Doyle) #7

Hi, what about the case where I want to make sure the index has been fully
deleted after issuing a delete request?

On Mon, Jul 12, 2010 at 3:10 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Let me just explain what it does, it will wait for 30 seconds (the default
timeout value) for the cluster to be in yellow state, which means at least
one shard per shard replica set has been allocated to a node.

-shay.banon

On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Ok great, I'll give that a try, thanks.

On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon <shay.banon@elasticsearch.com

wrote:

This might be because the index was created, but shards have not been
allocated to it yet. What you can do is use the cluster health API, here is
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I encountered
    problems before where I would attempt to index but the index was not yet
    available/created and would throw the exception so I put this check in.
    My first attempt to check would include the index name in the status
    request but that to would throw an exception, so I just do the request
    without any name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

Not sure I understand exactly what you do and when you get an
exception, can you explain it a bit better? A few questions, how do you get
a Client instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle samueldoyle@gmail.comwrote:

I'm many exceptions I have encountered previously, here is one to
start with.

When I attempt to do a batch index, I delete the old index and
recreate it. I then will check several times to see if the index exists
using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I
would get an exception if it didn't exist, now even not even specifying the
name I get the exception, I need to make sure the index exists before
continuing but this makes it impossible since the check itself throws the
exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Shay Banon) #8

That does not suffer from the above problem. One the method returns, the
index has deleted. Do you see something different?

-shay.banon

On Tue, Jul 13, 2010 at 7:26 AM, Samuel Doyle samueldoyle@gmail.com wrote:

Hi, what about the case where I want to make sure the index has been fully
deleted after issuing a delete request?

On Mon, Jul 12, 2010 at 3:10 PM, Shay Banon shay.banon@elasticsearch.comwrote:

Let me just explain what it does, it will wait for 30 seconds (the default
timeout value) for the cluster to be in yellow state, which means at least
one shard per shard replica set has been allocated to a node.

-shay.banon

On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Ok great, I'll give that a try, thanks.

On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

This might be because the index was created, but shards have not been
allocated to it yet. What you can do is use the cluster health API, here is
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I encountered
    problems before where I would attempt to index but the index was not yet
    available/created and would throw the exception so I put this check in.
    My first attempt to check would include the index name in the status
    request but that to would throw an exception, so I just do the request
    without any name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

Not sure I understand exactly what you do and when you get an
exception, can you explain it a bit better? A few questions, how do you get
a Client instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle <samueldoyle@gmail.com

wrote:

I'm many exceptions I have encountered previously, here is one to
start with.

When I attempt to do a batch index, I delete the old index and
recreate it. I then will check several times to see if the index exists
using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I
would get an exception if it didn't exist, now even not even specifying the
name I get the exception, I need to make sure the index exists before
continuing but this makes it impossible since the check itself throws the
exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(Samuel Doyle) #9

I was following the same pattern as on the create where I would test using
an IndicesStatusRequest after the DeleteIndexRequest to verify the delete.
If this is not needed it is good to know.

Thanks

On Tue, Jul 13, 2010 at 12:16 AM, Shay Banon
shay.banon@elasticsearch.comwrote:

That does not suffer from the above problem. One the method returns, the
index has deleted. Do you see something different?

-shay.banon

On Tue, Jul 13, 2010 at 7:26 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, what about the case where I want to make sure the index has been fully
deleted after issuing a delete request?

On Mon, Jul 12, 2010 at 3:10 PM, Shay Banon <shay.banon@elasticsearch.com

wrote:

Let me just explain what it does, it will wait for 30 seconds (the
default timeout value) for the cluster to be in yellow state, which means at
least one shard per shard replica set has been allocated to a node.

-shay.banon

On Tue, Jul 13, 2010 at 1:09 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Ok great, I'll give that a try, thanks.

On Mon, Jul 12, 2010 at 3:05 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

This might be because the index was created, but shards have not been
allocated to it yet. What you can do is use the cluster health API, here is
an example (using the new Java API):

client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet();

-shay.banon

On Tue, Jul 13, 2010 at 12:57 AM, Samuel Doyle samueldoyle@gmail.comwrote:

Hi, yes that is what I am doing.

node =
nodeBuilder().client(true).data(false).clusterName(clusterName).node()
client = node.client()

I have what I'm doing in the initial post,

  1. delete index
  2. create index
  3. verify index is created via the status request because I
    encountered problems before where I would attempt to index but the index was
    not yet available/created and would throw the exception so I put this check
    in.
    My first attempt to check would include the index name in the status
    request but that to would throw an exception, so I just do the request
    without any name and it would work.
    Now it throws the exception.

On Mon, Jul 12, 2010 at 2:38 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

Not sure I understand exactly what you do and when you get an
exception, can you explain it a bit better? A few questions, how do you get
a Client instance, out of a Node?

On Mon, Jul 12, 2010 at 11:26 PM, Samuel Doyle <
samueldoyle@gmail.com> wrote:

I'm many exceptions I have encountered previously, here is one to
start with.

When I attempt to do a batch index, I delete the old index and
recreate it. I then will check several times to see if the index exists
using:

statusResponse = client.admin().indices().status(new
IndicesStatusRequest()).actionGet() // If i specify a name for an index that
doesn't exist I get an exception.

Before if I specified the index name I had created in the request I
would get an exception if it didn't exist, now even not even specifying the
name I get the exception, I need to make sure the index exists before
continuing but this makes it impossible since the check itself throws the
exception.

Here is the link to the stacktrace: http://www.pastie.org/1041486


(system) #10