You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by kvanhorn <ka...@cable.comcast.com> on 2015/06/03 20:44:53 UTC

Getting error "unable to create sequence znode"

Greetings,

We are getting "unable to create sequence znode" consistently during our
nightly processing.  Does this sound familiar to anyone?  There is also a
"-9" associated with it...

Thanks,
Kara




--
View this message in context: http://zookeeper-user.578899.n2.nabble.com/Getting-error-unable-to-create-sequence-znode-tp7581162.html
Sent from the zookeeper-user mailing list archive at Nabble.com.

Re: Getting error "unable to create sequence znode"

Posted by kvanhorn <ka...@cable.comcast.com>.
Raul,

Thanks very much--I think that helps a great deal!  We'll put in that change
soon and see what happens.

Cheers,
Kara




--
View this message in context: http://zookeeper-user.578899.n2.nabble.com/Getting-error-unable-to-create-sequence-znode-tp7581162p7581167.html
Sent from the zookeeper-user mailing list archive at Nabble.com.

Re: Getting error "unable to create sequence znode"

Posted by Raúl Gutiérrez Segalés <rg...@itevenworks.net>.
On 3 June 2015 at 12:45, kvanhorn <ka...@cable.comcast.com> wrote:

> Hi Raul,
>
> Thanks for the quick reply.
>
> We're using the Perl (v 5.8.8) wrapper of the C library:
>
>     my $lock_tmpl = $lock_prefix . "/" . $lock_name . "-";
>     my $lock_path = $zkh->create($lock_tmpl, $self->{data},
>         flags => (ZOO_EPHEMERAL | ZOO_SEQUENCE),
>         acl   => ZOO_OPEN_ACL_UNSAFE) or
>     die "unable to create sequence znode $lock_tmpl: " . $zkh->get_error .
> "\n";
>
> My question was poorly phrased--I should have asked what would cause such
> an
> error?
>
> The "-9" is the result of the "get_error()" call in the Lock.pm code
> snippet
> above, but I have not been able to find where those numeric error values
> are
> located again.  I usually use the "str_error()" call instead, but this is
> in
> the Perl library, so...
>

So the Perl lib is a wrapper for the C lib, so that comes from:

src/c/include/zookeeper.h:  ZINVALIDSTATE = -9, /*!< Invliad zhandle state
*/

(see it here:
https://github.com/apache/zookeeper/blob/trunk/src/c/include/zookeeper.h#L95
)

It can happen when your session expired, for instance.



-rgs

Re: Getting error "unable to create sequence znode"

Posted by kvanhorn <ka...@cable.comcast.com>.
Hi Raul,

Thanks for the quick reply.

We're using the Perl (v 5.8.8) wrapper of the C library:

    my $lock_tmpl = $lock_prefix . "/" . $lock_name . "-";
    my $lock_path = $zkh->create($lock_tmpl, $self->{data},
        flags => (ZOO_EPHEMERAL | ZOO_SEQUENCE),
        acl   => ZOO_OPEN_ACL_UNSAFE) or
    die "unable to create sequence znode $lock_tmpl: " . $zkh->get_error .
"\n";

My question was poorly phrased--I should have asked what would cause such an
error?

The "-9" is the result of the "get_error()" call in the Lock.pm code snippet
above, but I have not been able to find where those numeric error values are
located again.  I usually use the "str_error()" call instead, but this is in
the Perl library, so...

As for the sequence number, we are well below the limit of the number of
places provided, thankfully, but I do not know what would prevent the
creation of such a number under normal (or abnormal) circumstances....? 
This error only appears something like 11 out of 10,000 times under fairly
heavy load.

We only use one ZooKeeper server at this time and it is on the same machine
as the daily processing.

Hope this helps,
Kara



--
View this message in context: http://zookeeper-user.578899.n2.nabble.com/Getting-error-unable-to-create-sequence-znode-tp7581162p7581165.html
Sent from the zookeeper-user mailing list archive at Nabble.com.

Re: Getting error "unable to create sequence znode"

Posted by Raúl Gutiérrez Segalés <rg...@itevenworks.net>.
Hi,

On 3 June 2015 at 11:44, kvanhorn <ka...@cable.comcast.com> wrote:

> Greetings,
>
> We are getting "unable to create sequence znode" consistently during our
> nightly processing.  Does this sound familiar to anyone?  There is also a
> "-9" associated with it...
>

What library are you using (Java, C, Python, ..)? Could you provide the
code snippet and/or the log output so we can take a look? From the docs,
note this:

"the counter used to store the next sequence number is a signed int
(4bytes) maintained by the parent node, the counter will overflow when
incremented beyond 2147483647 (resulting in a name "<path>-2147483647"). "

Maybe you are getting the minus sign and your code is not checking for that?


-rgs