Merge branch 'cassandra-2.2' into cassandra-3.0
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f21c8885 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f21c8885 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f21c8885 Branch: refs/heads/trunk Commit: f21c888510b0dbbea1a63459476f2dc54093de63 Parents: 6d0c96c 7cab327 Author: Aleksey Yeschenko <alek...@apache.org> Authored: Wed Oct 14 16:02:56 2015 +0100 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Wed Oct 14 16:02:56 2015 +0100 ---------------------------------------------------------------------- CHANGES.txt | 1 + NEWS.txt | 20 ++++++++++++++++++++ conf/cassandra-rackdc.properties | 4 ++-- conf/cassandra.yaml | 3 +++ .../org/apache/cassandra/db/SystemKeyspace.java | 14 ++++++++++++++ .../cassandra/service/CassandraDaemon.java | 13 +++++++++++++ 6 files changed, 53 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f21c8885/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index d0b90ef,57c6ff9..1a43cfc --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -12,40 -8,27 +12,41 @@@ Merged from 2.2 * Avoid NoClassDefFoundError during DataDescriptor initialization on windows (CASSANDRA-10412) * Preserve case of quoted Role & User names (CASSANDRA-10394) * cqlsh pg-style-strings broken (CASSANDRA-10484) - * Make Hadoop CF splits more polite to custom orderered partitioners (CASSANDRA-10400) - * Fix the regression when using LIMIT with aggregates (CASSANDRA-10487) + * cqlsh prompt includes name of keyspace after failed `use` statement (CASSANDRA-10369) Merged from 2.1: - * Fix mmap file segment seeking to EOF (CASSANDRA-10478) ++ * Don't allow startup if the node's rack has changed (CASSANDRA-10242) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) * Allow LOCAL_JMX to be easily overridden (CASSANDRA-10275) * Mark nodes as dead even if they've already left (CASSANDRA-10205) - * Update internal python driver used by cqlsh (CASSANDRA-10161, CASSANDRA-10507) -2.2.2 - * cqlsh prompt includes name of keyspace after failed `use` statement (CASSANDRA-10369) +3.0.0-rc1 + * Fix mixed version read request compatibility for compact static tables + (CASSANDRA-10373) + * Fix paging of DISTINCT with static and IN (CASSANDRA-10354) + * Allow MATERIALIZED VIEW's SELECT statement to restrict primary key + columns (CASSANDRA-9664) + * Move crc_check_chance out of compression options (CASSANDRA-9839) + * Fix descending iteration past end of BTreeSearchIterator (CASSANDRA-10301) + * Transfer hints to a different node on decommission (CASSANDRA-10198) + * Check partition keys for CAS operations during stmt validation (CASSANDRA-10338) + * Add custom query expressions to SELECT (CASSANDRA-10217) + * Fix minor bugs in MV handling (CASSANDRA-10362) + * Allow custom indexes with 0,1 or multiple target columns (CASSANDRA-10124) + * Improve MV schema representation (CASSANDRA-9921) + * Add flag to enable/disable coordinator batchlog for MV writes (CASSANDRA-10230) + * Update cqlsh COPY for new internal driver serialization interface (CASSANDRA-10318) + * Give index implementations more control over rebuild operations (CASSANDRA-10312) + * Update index file format (CASSANDRA-10314) + * Add "shadowable" row tombstones to deal with mv timestamp issues (CASSANDRA-10261) + * CFS.loadNewSSTables() broken for pre-3.0 sstables + * Cache selected index in read command to reduce lookups (CASSANDRA-10215) + * Small optimizations of sstable index serialization (CASSANDRA-10232) + * Support for both encrypted and unencrypted native transport connections (CASSANDRA-9590) +Merged from 2.2: * Configurable page size in cqlsh (CASSANDRA-9855) * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) - * Cancel transaction for sstables we wont redistribute index summary - for (CASSANDRA-10270) - * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) - * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) - * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) - * Fix repair hang when snapshot failed (CASSANDRA-10057) - * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks - (CASSANDRA-10199) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) Merged from 2.1: * Bulk Loader API could not tolerate even node failure (CASSANDRA-10347) * Avoid misleading pushed notifications when multiple nodes http://git-wip-us.apache.org/repos/asf/cassandra/blob/f21c8885/NEWS.txt ---------------------------------------------------------------------- diff --cc NEWS.txt index b422453,a235a1d..c36481e --- a/NEWS.txt +++ b/NEWS.txt @@@ -13,108 -13,26 +13,128 @@@ restore snapshots created with the prev 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. +3.0 +=== + +New features +------------ + - Support for IN restrictions on any partition key component or clustering key + as well as support for EQ and IN multicolumn restrictions has been added to + UPDATE and DELETE statement. + - Support for single-column and multi-colum slice restrictions (>, >=, <= and <) + has been added to DELETE statements + - nodetool rebuild_index accepts the index argument without + the redundant table name + - Materialized Views, which allow for server-side denormalization, is now + available. Materialized views provide an alternative to secondary indexes + for non-primary key queries, and perform much better for indexing high + cardinality columns. + See http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views + - Hinted handoff has been completely rewritten. Hints are now stored in flat + files, with less overhead for storage and more efficient dispatch. + See CASSANDRA-6230 for full details. + - Option to not purge unrepaired tombstones. To avoid users having data resurrected + if repair has not been run within gc_grace_seconds, an option has been added to + only allow tombstones from repaired sstables to be purged. To enable, set the + compaction option 'only_purge_repaired_tombstones':true but keep in mind that if + you do not run repair for a long time, you will keep all tombstones around which + can cause other problems. + - Enabled warning on GC taking longer than 1000ms. See + cassandra.yaml:gc_warn_threshold_in_ms + +Upgrading +--------- + - Upgrade to 3.0 is supported from Cassandra 2.1 versions greater or equal to 2.1.9, + or Cassandra 2.2 versions greater or equal to 2.2.1. Upgrade from Cassandra 2.0 and + older versions is not supported. + - The 'memtable_allocation_type: offheap_objects' option has been removed. It should + be re-introduced in a future release and you can follow CASSANDRA-9472 to know more. + - The native protocol versions 1 and 2 are not supported anymore. + - Max mutation size is now configurable via max_mutation_size_in_kb setting in + cassandra.yaml; the default is half the size commitlog_segment_size_in_mb * 1024. + - 3.0 requires Java 8u40 or later. + - The default JVM GC has been changed to G1GC. + - New transaction log files have been introduced to replace the compactions_in_progress + system table, temporary file markers (tmp and tmplink) and sstable ancerstors. + Therefore, compaction metadata no longer contains ancestors. Transaction log files + list sstable descriptors involved in compactions and other operations such as flushing + and streaming. Use the sstableutil tool to list any sstable files currently involved + in operations not yet completed, which previously would have been marked as temporary. + A transaction log file contains one sstable per line, with the prefix "add:" or "remove:". + They also contain a special line "commit", only inserted at the end when the transaction + is committed. On startup we use these files to cleanup any partial transactions that were + in progress when the process exited. If the commit line is found, we keep new sstables + (those with the "add" prefix) and delete the old sstables (those with the "remove" prefix), + vice-versa if the commit line is missing. Should you lose or delete these log files, + both old and new sstable files will be kept as live files, which will result in duplicated + sstables. These files are protected by incremental checksums so you should not manually + edit them. When restoring a full backup or moving sstable files, you should clean-up + any left over transactions and their temporary files first. You can use this command: + ===> sstableutil -c ks table + See CASSANDRA-7066 for full details. + - New write stages have been added for batchlog and materialized view mutations + you can set their size in cassandra.yaml + - User defined functions are now executed in a sandbox. + To use UDFs and UDAs, you have to enable them in cassandra.yaml. + - New SSTable version 'la' with improved bloom-filter false-positive handling + compared to previous version 'ka' used in 2.2 and 2.1. Running sstableupgrade + is not necessary but recommended. + - Before upgrading to 3.0, make sure that your cluster is in complete agreement + (schema versions outputted by `nodetool describecluster` are all the same). + - Schema metadata is now stored in the new `system_schema` keyspace, and + legacy `system.schema_*` tables are now gone; see CASSANDRA-6717 for details. + - Pig's CassandraStorage has been removed. Use CqlNativeStorage instead. + - Hadoop BulkOutputFormat and BulkRecordWriter have been removed; use + CqlBulkOutputFormat and CqlBulkRecordWriter instead. + - Hadoop ColumnFamilyInputFormat and ColumnFamilyOutputFormat have been removed; + use CqlInputFormat and CqlOutputFormat instead. + - Hadoop ColumnFamilyRecordReader and ColumnFamilyRecordWriter have been removed; + use CqlRecordReader and CqlRecordWriter instead. + - hinted_handoff_enabled in cassandra.yaml no longer supports a list of data centers. + To specify a list of excluded data centers when hinted_handoff_enabled is set to true, + use hinted_handoff_disabled_datacenters, see CASSANDRA-9035 for details. + - The `sstable_compression` and `chunk_length_kb` compression options have been deprecated. + The new options are `class` and `chunk_length_in_kb`. Disabling compression should now + be done by setting the new option `enabled` to `false`. + - The compression option `crc_check_chance` became a top-level table option, but is currently + enforced only against tables with enabled compression. + - Only map syntax is now allowed for caching options. ALL/NONE/KEYS_ONLY/ROWS_ONLY syntax + has been deprecated since 2.1.0 and is being removed in 3.0.0. + - The 'index_interval' option for 'CREATE TABLE' statements, which has been deprecated + since 2.1 and replaced with the 'min_index_interval' and 'max_index_interval' options, + has now been removed. + - Batchlog entries are now stored in a new table - system.batches. + The old one has been deprecated. + - JMX methods set/getCompactionStrategyClass have been removed, use + set/getCompactionParameters or set/getCompactionParametersJson instead. + - SizeTieredCompactionStrategy parameter cold_reads_to_omit has been removed. + - The secondary index API has been comprehensively reworked. This will be a breaking + change for any custom index implementations, which should now look to implement + the new org.apache.cassandra.index.Index interface. New syntax has been added to create + and query row-based indexes, which are not explicitly linked to a single column in the + base table. + + + 2.2.4 + ===== + + Operations + ---------- + - Switching racks is no longer an allowed operation on a node which has + data. Instead, the node will need to be wiped and bootstrapped. If + moving from the SimpleSnitch, make sure the rack containing all current + nodes is named "rack1". + + + 2.2.3 + ===== + + Upgrading + --------- + - Nothing specific to this release, but please see 2.2 if you are upgrading + from a previous version. + + 2.2.2 ===== http://git-wip-us.apache.org/repos/asf/cassandra/blob/f21c8885/conf/cassandra.yaml ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f21c8885/src/java/org/apache/cassandra/db/SystemKeyspace.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/SystemKeyspace.java index 6112869,62bf59e..651353d --- a/src/java/org/apache/cassandra/db/SystemKeyspace.java +++ b/src/java/org/apache/cassandra/db/SystemKeyspace.java @@@ -1069,11 -881,25 +1069,25 @@@ public final class SystemKeyspac return hostId; } + /** + * Gets the stored rack for the local node, or null if none have been set yet. + */ + public static String getRack() + { + String req = "SELECT rack FROM system.%s WHERE key='%s'"; + UntypedResultSet result = executeInternal(String.format(req, LOCAL, LOCAL)); + + // Look up the Rack (return it if found) + if (!result.isEmpty() && result.one().has("rack")) + return result.one().getString("rack"); + + return null; + } - public static PaxosState loadPaxosState(ByteBuffer key, CFMetaData metadata) + public static PaxosState loadPaxosState(DecoratedKey key, CFMetaData metadata) { String req = "SELECT * FROM system.%s WHERE row_key = ? AND cf_id = ?"; - UntypedResultSet results = executeInternal(String.format(req, PAXOS), key, metadata.cfId); + UntypedResultSet results = executeInternal(String.format(req, PAXOS), key.getKey(), metadata.cfId); if (results.isEmpty()) return new PaxosState(key, metadata); UntypedResultSet.Row row = results.one(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/f21c8885/src/java/org/apache/cassandra/service/CassandraDaemon.java ----------------------------------------------------------------------