cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Pyykkö <>
Subject Incorrect override of manifest.json?
Date Fri, 17 Apr 2015 07:29:37 GMT
Hi all,

In Cassandra 2.1.3 the code below is located in the class which
is called when you do a snapshot. What I can se happens is that it first creates a snapshot
manifest file correctly for a column family but than the loop returns a index which overrides
the data that was written in the first iteration. Isn´t the code incorrect and the JSONArray
should be located before the outer for-loop or some other solution so it does´t override
content that has once been written?

From the call "concatWithIndexes()" I see it returns [CFS(Keyspace=’X', ColumnFamily='tempState'),
CFS(Keyspace=’X', ColumnFamily='tempState.tempState_current_idx’)] and the first iteration
writes correct data to the manifest.json and the second iteration overrides the data with
a empty "filesJSONArr”.

Can somebody please confirm if this is a bug, or if I should write one?

//Kind Regards, Daniel

public void snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate)
        for (ColumnFamilyStore cfs : concatWithIndexes())
            final JSONArray filesJSONArr = new JSONArray();
            try (RefViewFragment currentView = cfs.selectAndReference(ALL_SSTABLES))
                for (SSTableReader ssTable : currentView.sstables)
                    if (ssTable.openReason == SSTableReader.OpenReason.EARLY || (predicate
!= null && !predicate.apply(ssTable)))

                    File snapshotDirectory = Directories.getSnapshotDirectory(ssTable.descriptor,
                    ssTable.createLinks(snapshotDirectory.getPath()); // hard links
                    if (logger.isDebugEnabled())
                        logger.debug("Snapshot for {} keyspace data file {} created in {}",
keyspace, ssTable.getFilename(), snapshotDirectory);

                writeSnapshotManifest(filesJSONArr, snapshotName);
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message