You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Brandon Williams (JIRA)" <ji...@apache.org> on 2012/07/24 22:44:34 UTC

[jira] [Commented] (CASSANDRA-4460) SystemTable.setBootstrapState always sets bootstrap state to true

    [ https://issues.apache.org/jira/browse/CASSANDRA-4460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421741#comment-13421741 ] 

Brandon Williams commented on CASSANDRA-4460:
---------------------------------------------

Actually, it breaks, and buildbot knows it:

{noformat}

ERROR [main] 2012-07-24 14:31:19,156 CassandraDaemon.java (line 335) Exception encountered during startup
java.lang.IndexOutOfBoundsException
        at java.nio.Buffer.checkIndex(Buffer.java:520)
        at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:340)
        at org.apache.cassandra.utils.ByteBufferUtil.toInt(ByteBufferUtil.java:414)
        at org.apache.cassandra.cql.jdbc.JdbcInt32.compose(JdbcInt32.java:94)
        at org.apache.cassandra.db.marshal.Int32Type.compose(Int32Type.java:33)
        at org.apache.cassandra.cql3.UntypedResultSet$Row.getInt(UntypedResultSet.java:104)
        at org.apache.cassandra.db.SystemTable.getBootstrapState(SystemTable.java:375)
        at org.apache.cassandra.db.SystemTable.setBootstrapState(SystemTable.java:391)
        at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:691)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:476)
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:367)
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:228)
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:318)
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:361)
{noformat}

Obviously we should be using %i instead.
                
> SystemTable.setBootstrapState always sets bootstrap state to true
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-4460
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4460
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2
>            Reporter: Dave Brosius
>            Priority: Trivial
>
>     public static void setBootstrapState(BootstrapState state)
>     {
>         String req = "INSERT INTO system.%s (key, bootstrapped) VALUES ('%s', '%b')";
>         processInternal(String.format(req, LOCAL_CF, LOCAL_KEY, getBootstrapState()));
>         forceBlockingFlush(LOCAL_CF);
>     }
> Third parameter %b is set from getBootstrapState() which returns an enum, thus %b collapses to null/non null checks. This would seem then to always set it to true.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira