cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefania (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-10151) Fix TrackerTest.testTryModify
Date Fri, 21 Aug 2015 08:02:46 GMT

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

Stefania edited comment on CASSANDRA-10151 at 8/21/15 8:02 AM:
---------------------------------------------------------------

[~benedict] , in the 5th line here did you mean to use the generation 0? If so, should we
keep a reference? 

{code}
        ColumnFamilyStore cfs = MockSchema.newCFS();
        Tracker tracker = new Tracker(cfs, false);
        List<SSTableReader> readers = ImmutableList.of(MockSchema.sstable(0, cfs), MockSchema.sstable(1,
cfs), MockSchema.sstable(2, cfs));
        tracker.addInitialSSTables(copyOf(readers));
        Assert.assertNull(tracker.tryModify(ImmutableList.of(MockSchema.sstable(0, cfs)),
OperationType.COMPACTION));
        try (LifecycleTransaction txn = tracker.tryModify(readers.get(0), OperationType.COMPACTION);)
        {
            Assert.assertNotNull(txn);
            Assert.assertNull(tracker.tryModify(readers.get(0), OperationType.COMPACTION));
            Assert.assertEquals(1, txn.originals().size());
            Assert.assertTrue(txn.originals().contains(readers.get(0)));
        }
        try (LifecycleTransaction txn = tracker.tryModify(Collections.<SSTableReader>emptyList(),
OperationType.COMPACTION);)
        {
            Assert.assertNotNull(txn);
            Assert.assertEquals(0, txn.originals().size());
        }
    }
{code}


was (Author: stefania):
[~benedict] , in the 5th line here did you mean to use the generation 0? If so, should we
keep a reference? 

{code}
        ColumnFamilyStore cfs = MockSchema.newCFS();
        Tracker tracker = new Tracker(cfs, false);
        List<SSTableReader> readers = ImmutableList.of(MockSchema.sstable(0, cfs), MockSchema.sstable(1,
cfs), MockSchema.sstable(2, cfs));
        tracker.addInitialSSTables(copyOf(readers));
        Assert.assertNull(tracker.tryModify(ImmutableList.of(MockSchema.sstable(0, cfs)),
OperationType.COMPACTION));
        try (LifecycleTransaction txn = tracker.tryModify(readers.get(0), OperationType.COMPACTION);)
        {
            Assert.assertNotNull(txn);
            Assert.assertNull(tracker.tryModify(readers.get(0), OperationType.COMPACTION));
            Assert.assertEquals(1, txn.originals().size());
            Assert.assertTrue(txn.originals().contains(readers.get(0)));
        }
        try (LifecycleTransaction txn = tracker.tryModify(Collections.<SSTableReader>emptyList(),
OperationType.COMPACTION);)
        {
            Assert.assertNotNull(txn);
            Assert.assertEquals(0, txn.originals().size());
        }
    }

> Fix TrackerTest.testTryModify
> -----------------------------
>
>                 Key: CASSANDRA-10151
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10151
>             Project: Cassandra
>          Issue Type: Test
>            Reporter: Stefania
>            Assignee: Stefania
>
> TrackerTest.testTryModify has started failing on trunk and 3.0:
> http://cassci.datastax.com/job/cassandra-3.0_testall/53/testReport/org.apache.cassandra.db.lifecycle/TrackerTest/testTryModify/
> {code}
> junit.framework.AssertionFailedError
> 	at org.apache.cassandra.utils.concurrent.Ref$State.assertNotReleased(Ref.java:165)
> 	at org.apache.cassandra.utils.concurrent.Ref.ref(Ref.java:121)
> 	at org.apache.cassandra.io.sstable.format.SSTableReader$GlobalTidy.get(SSTableReader.java:2251)
> 	at org.apache.cassandra.io.sstable.format.SSTableReader$InstanceTidier.setup(SSTableReader.java:2099)
> 	at org.apache.cassandra.io.sstable.format.SSTableReader.setup(SSTableReader.java:2040)
> 	at org.apache.cassandra.io.sstable.format.SSTableReader.internalOpen(SSTableReader.java:575)
> 	at org.apache.cassandra.MockSchema.sstable(MockSchema.java:124)
> 	at org.apache.cassandra.MockSchema.sstable(MockSchema.java:79)
> 	at org.apache.cassandra.MockSchema.sstable(MockSchema.java:74)
> 	at org.apache.cassandra.db.lifecycle.TrackerTest.testTryModify(TrackerTest.java:86)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message