You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2019/12/11 08:10:40 UTC

[cassandra] 01/01: Merge branch 'cassandra-3.0' into cassandra-3.11

This is an automated email from the ASF dual-hosted git repository.

marcuse pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 0225d7c358d51f5c6f7f6832d774cfbd02cc6050
Merge: f788a80 af963e3
Author: Marcus Eriksson <ma...@apache.org>
AuthorDate: Wed Dec 11 08:58:36 2019 +0100

    Merge branch 'cassandra-3.0' into cassandra-3.11

 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/db/lifecycle/LogFile.java | 71 ++++++++++++++--------
 .../apache/cassandra/db/lifecycle/LogRecord.java   | 48 +++++++--------
 .../cassandra/db/lifecycle/LogTransaction.java     |  4 +-
 4 files changed, 71 insertions(+), 53 deletions(-)

diff --cc CHANGES.txt
index 548a7b1,f47bfa8..a75c06f
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,7 -1,5 +1,8 @@@
 -3.0.20
 +3.11.6
 + * Fix SELECT JSON formatting for the "duration" type (CASSANDRA-15075)
 + * Fix LegacyLayout to have same behavior as 2.x when handling unknown column names (CASSANDRA-15081)
 +Merged from 3.0:
+  * Avoid over-scanning data directories in LogFile.verify() (CASSANDRA-15364)
   * Bump generations and document changes to system_distributed and system_traces in 3.0, 3.11
     (CASSANDRA-15441)
   * Fix system_traces creation timestamp; optimise system keyspace upgrades (CASSANDRA-15398)
diff --cc src/java/org/apache/cassandra/db/lifecycle/LogFile.java
index 1dc139c,6e820df..0ff7cf1
--- a/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
+++ b/src/java/org/apache/cassandra/db/lifecycle/LogFile.java
@@@ -220,12 -230,13 +234,12 @@@ final class LogFile implements AutoClos
          // file that obsoleted the very same files. So we check the latest update time and make sure
          // it matches. Because we delete files from oldest to newest, the latest update time should
          // always match.
-         record.status.onDiskRecord = record.withExistingFiles();
+         record.status.onDiskRecord = record.withExistingFiles(existingFiles);
          if (record.updateTime != record.status.onDiskRecord.updateTime && record.status.onDiskRecord.updateTime > 0)
          {
 -            record.setError(String.format("Unexpected files detected for sstable [%s], " +
 -                                          "record [%s]: last update time [%tT] should have been [%tT]",
 +            record.setError(String.format("Unexpected files detected for sstable [%s]: " +
 +                                          "last update time [%tT] should have been [%tT]",
                                            record.fileName(),
 -                                          record,
                                            record.status.onDiskRecord.updateTime,
                                            record.updateTime));
  
@@@ -302,14 -314,11 +316,12 @@@
          return LogRecord.make(type, tables);
      }
  
-     private LogRecord makeRecord(Type type, SSTable table)
+     private LogRecord makeAddRecord(SSTable table)
      {
-         assert type == Type.ADD || type == Type.REMOVE;
- 
 -        File folder = table.descriptor.directory;
 -        replicas.maybeCreateReplica(folder, getFileName(folder), records);
 +        File directory = table.descriptor.directory;
 +        String fileName = StringUtils.join(directory, File.separator, getFileName());
 +        replicas.maybeCreateReplica(directory, fileName, records);
-         return LogRecord.make(type, table);
+         return LogRecord.make(Type.ADD, table);
      }
  
      /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org