Pruning incompete on simple DUPLICATE_KEY error

Bug #1133039 reported by Nathan Williams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Akiban Persistit
Fix Released
High
Peter Beaman

Bug Description

Server: r2590
Persistit: r422

First noticed when testing REST POST, but happens through SQL just as easily:

test=> CREATE TABLE t(id INT NOT NULL PRIMARY KEY);
CREATE TABLE
test=> INSERT INTO t VALUES (1);
INSERT 0 1
test=> INSERT INTO t VALUES (1);
ERROR: Non-unique key for index PRIMARY: {(long)1}

And shortly thereafter, pruning warnings star to appear in the log:
2013-02-25 18:04:18,513 [PostgresServer_Session-1] INFO AISDDL - DDL in test: CREATE TABLE t(id INT NOT NULL PRIMARY KEY);
2013-02-25 18:04:24,246 [PostgresServer_Session-1] WARN PostgresServerConnection - Error in query INSERT INTO t VALUES (1);
com.akiban.server.error.DuplicateKeyException: DUPLICATE_KEY: Non-unique key for index PRIMARY: {(long)1}
 at com.akiban.server.store.PersistitStore.checkUniqueness(PersistitStore.java:1255)
 at com.akiban.server.store.PersistitStore.insertIntoIndex(PersistitStore.java:1225)
 at com.akiban.server.store.PersistitStore.insertIntoIndex(PersistitStore.java:1211)
 at com.akiban.server.store.PersistitStore.writeRowStandard(PersistitStore.java:455)
 at com.akiban.server.store.PersistitStore.writeRow(PersistitStore.java:415)
 at com.akiban.server.store.DelegatingStore.writeRow(DelegatingStore.java:94)
 at com.akiban.qp.persistitadapter.OperatorStore.writeRow(OperatorStore.java:189)
 at com.akiban.qp.persistitadapter.PersistitAdapter.writeRow(PersistitAdapter.java:157)
 at com.akiban.qp.operator.Insert_Returning$Execution.next(Insert_Returning.java:173)
 at com.akiban.qp.operator.Insert_Returning$Execution.next(Insert_Returning.java:137)
 at com.akiban.qp.operator.ChainedCursor.next(ChainedCursor.java:49)
 at com.akiban.qp.operator.ChainedCursor.next(ChainedCursor.java:32)
 at com.akiban.sql.pg.PostgresModifyOperatorStatement.execute(PostgresModifyOperatorStatement.java:167)
 at com.akiban.sql.pg.PostgresServerConnection.executeStatement(PostgresServerConnection.java:1147)
 at com.akiban.sql.pg.PostgresServerConnection.processQuery(PostgresServerConnection.java:694)
 at com.akiban.sql.pg.PostgresServerConnection.topLevel(PostgresServerConnection.java:263)
 at com.akiban.sql.pg.PostgresServerConnection.run(PostgresServerConnection.java:179)
 at java.lang.Thread.run(Thread.java:722)
2013-02-25 18:04:24,631 [CLEANUP_MANAGER] WARN TreeService - [CLEANUP_MANAGER] WARNING Transaction <ts=5,098 tc=ABORTED mvv=1> pruning incomplete at JournalAddress 1,200,882{5,098} after rollback
2013-02-25 18:04:29,637 [CLEANUP_MANAGER] WARN TreeService - [CLEANUP_MANAGER] WARNING Transaction <ts=5,098 tc=ABORTED mvv=1> pruning incomplete at JournalAddress 1,200,882{5,098} after rollback
<repeat forever>

Marking as HIGH as this will fill up the log with cruft and, more importantly, keep journal files around.

Related branches

Revision history for this message
Nathan Williams (nwilliams) wrote :

Looks like it is somehow related to the recently added lock mechanism. The warning doesn't happen if everything in PersistitStore#lockKey() is commented out.

This is probably a Persistit bug, and not server, but I'll leave it as-is until fully confirmed.

Revision history for this message
Nathan Williams (nwilliams) wrote :

Looks like this is now fixed thanks to the (now attached) Persistit branch.

information type: Proprietary → Public
affects: akiban-server → akiban-persistit
Changed in akiban-persistit:
status: New → Fix Released
assignee: nobody → Peter Beaman (pbeaman)
milestone: none → 3.2.6
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.