Merge branch 'cassandra-1.2' into trunk Conflicts: src/java/org/apache/cassandra/service/StorageService.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/28028496 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/28028496 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/28028496 Branch: refs/heads/trunk Commit: 280284961f3fbea6d5638c94d19768afaeaaac43 Parents: 40cf7b0 ba6396a Author: Brandon Williams <brandonwilli...@apache.org> Authored: Mon Jul 15 15:56:08 2013 -0500 Committer: Brandon Williams <brandonwilli...@apache.org> Committed: Mon Jul 15 15:56:08 2013 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/config/DatabaseDescriptor.java | 16 ++++++++++++ .../cassandra/service/StorageService.java | 27 ++++++++++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/28028496/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index ddb46f1,ee277aa..63c85af --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,89 -1,5 +1,90 @@@ +2.0.0-beta2 + * Allow nodetool with no args, and with help to run without a server (CASSANDRA-5734) + * Cleanup AbstractType/TypeSerializer classes (CASSANDRA-5744) + * Remove unimplemented cli option schema-mwt (CASSANDRA-5754) + * Support range tombstones in thrift (CASSANDRA-5435) + * Normalize table-manipulating CQL3 statements' class names (CASSANDRA-5759) + * cqlsh: add missing table options to DESCRIBE output (CASSANDRA-5749) + +2.0.0-beta1 + * Removed on-heap row cache (CASSANDRA-5348) + * use nanotime consistently for node-local timeouts (CASSANDRA-5581) + * Avoid unnecessary second pass on name-based queries (CASSANDRA-5577) + * Experimental triggers (CASSANDRA-1311) + * JEMalloc support for off-heap allocation (CASSANDRA-3997) + * Single-pass compaction (CASSANDRA-4180) + * Removed token range bisection (CASSANDRA-5518) + * Removed compatibility with pre-1.2.5 sstables and network messages + (CASSANDRA-5511) + * removed PBSPredictor (CASSANDRA-5455) + * CAS support (CASSANDRA-5062, 5441, 5442, 5443, 5619, 5667) + * Leveled compaction performs size-tiered compactions in L0 + (CASSANDRA-5371, 5439) + * Add yaml network topology snitch for mixed ec2/other envs (CASSANDRA-5339) + * Log when a node is down longer than the hint window (CASSANDRA-4554) + * Optimize tombstone creation for ExpiringColumns (CASSANDRA-4917) + * Improve LeveledScanner work estimation (CASSANDRA-5250, 5407) + * Replace compaction lock with runWithCompactionsDisabled (CASSANDRA-3430) + * Change Message IDs to ints (CASSANDRA-5307) + * Move sstable level information into the Stats component, removing the + need for a separate Manifest file (CASSANDRA-4872) + * avoid serializing to byte[] on commitlog append (CASSANDRA-5199) + * make index_interval configurable per columnfamily (CASSANDRA-3961, CASSANDRA-5650) + * add default_time_to_live (CASSANDRA-3974) + * add memtable_flush_period_in_ms (CASSANDRA-4237) + * replace supercolumns internally by composites (CASSANDRA-3237, 5123) + * upgrade thrift to 0.9.0 (CASSANDRA-3719) + * drop unnecessary keyspace parameter from user-defined compaction API + (CASSANDRA-5139) + * more robust solution to incomplete compactions + counters (CASSANDRA-5151) + * Change order of directory searching for c*.in.sh (CASSANDRA-3983) + * Add tool to reset SSTable compaction level for LCS (CASSANDRA-5271) + * Allow custom configuration loader (CASSANDRA-5045) + * Remove memory emergency pressure valve logic (CASSANDRA-3534) + * Reduce request latency with eager retry (CASSANDRA-4705) + * cqlsh: Remove ASSUME command (CASSANDRA-5331) + * Rebuild BF when loading sstables if bloom_filter_fp_chance + has changed since compaction (CASSANDRA-5015) + * remove row-level bloom filters (CASSANDRA-4885) + * Change Kernel Page Cache skipping into row preheating (disabled by default) + (CASSANDRA-4937) + * Improve repair by deciding on a gcBefore before sending + out TreeRequests (CASSANDRA-4932) + * Add an official way to disable compactions (CASSANDRA-5074) + * Reenable ALTER TABLE DROP with new semantics (CASSANDRA-3919) + * Add binary protocol versioning (CASSANDRA-5436) + * Swap THshaServer for TThreadedSelectorServer (CASSANDRA-5530) + * Add alias support to SELECT statement (CASSANDRA-5075) + * Don't create empty RowMutations in CommitLogReplayer (CASSANDRA-5541) + * Use range tombstones when dropping cfs/columns from schema (CASSANDRA-5579) + * cqlsh: drop CQL2/CQL3-beta support (CASSANDRA-5585) + * Track max/min column names in sstables to be able to optimize slice + queries (CASSANDRA-5514, CASSANDRA-5595, CASSANDRA-5600) + * Binary protocol: allow batching already prepared statements (CASSANDRA-4693) + * Allow preparing timestamp, ttl and limit in CQL3 queries (CASSANDRA-4450) + * Support native link w/o JNA in Java7 (CASSANDRA-3734) + * Use SASL authentication in binary protocol v2 (CASSANDRA-5545) + * Replace Thrift HsHa with LMAX Disruptor based implementation (CASSANDRA-5582) + * cqlsh: Add row count to SELECT output (CASSANDRA-5636) + * Include a timestamp with all read commands to determine column expiration + (CASSANDRA-5149) + * Streaming 2.0 (CASSANDRA-5286, 5699) + * Conditional create/drop ks/table/index statements in CQL3 (CASSANDRA-2737) + * more pre-table creation property validation (CASSANDRA-5693) + * Redesign repair messages (CASSANDRA-5426) + * Fix ALTER RENAME post-5125 (CASSANDRA-5702) + * Disallow renaming a 2ndary indexed column (CASSANDRA-5705) + * Rename Table to Keyspace (CASSANDRA-5613) + * Ensure changing column_index_size_in_kb on different nodes don't corrupt the + sstable (CASSANDRA-5454) + * Move resultset type information into prepare, not execute (CASSANDRA-5649) + * Auto paging in binary protocol (CASSANDRA-4415, 5714) + * Don't tie client side use of AbstractType to JDBC (CASSANDRA-4495) + * Adds new TimestampType to replace DateType (CASSANDRA-5723, CASSANDRA-5729) + + 1.2.7 + * Add replace_node functionality for vnodes (CASSANDRA-5337) * Add timeout events to query traces (CASSANDRA-5520) * make starting native protocol server idempotent (CASSANDRA-5728) * Fix loading key cache when a saved entry is no longer valid (CASSANDRA-5706) http://git-wip-us.apache.org/repos/asf/cassandra/blob/28028496/src/java/org/apache/cassandra/config/DatabaseDescriptor.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/28028496/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/StorageService.java index dbd15da,e556306..7102c7e --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@@ -545,9 -572,9 +545,9 @@@ public class StorageService extends Not // (we won't be part of the storage ring though until we add a counterId to our state, below.) Map<ApplicationState, VersionedValue> appStates = new HashMap<ApplicationState, VersionedValue>(); appStates.put(ApplicationState.NET_VERSION, valueFactory.networkVersion()); - appStates.put(ApplicationState.HOST_ID, valueFactory.hostId(SystemTable.getLocalHostId())); + appStates.put(ApplicationState.HOST_ID, valueFactory.hostId(SystemKeyspace.getLocalHostId())); appStates.put(ApplicationState.RPC_ADDRESS, valueFactory.rpcaddress(DatabaseDescriptor.getRpcAddress())); - if (0 != DatabaseDescriptor.getReplaceTokens().size()) + if (DatabaseDescriptor.isReplacing()) appStates.put(ApplicationState.STATUS, valueFactory.hibernate(true)); appStates.put(ApplicationState.RELEASE_VERSION, valueFactory.releaseVersion()); Gossiper.instance.register(this); @@@ -626,12 -667,32 +626,25 @@@ } else { + // Sleeping additionally to make sure that the server actually is not alive + // and giving it more time to gossip if alive. + Uninterruptibles.sleepUninterruptibly(LoadBroadcaster.BROADCAST_INTERVAL, TimeUnit.MILLISECONDS); + if (DatabaseDescriptor.getReplaceTokens().size() != 0 && DatabaseDescriptor.getReplaceNode() != null) + throw new UnsupportedOperationException("You cannot specify both replace_token and replace_node, choose one or the other"); - try - { - // Sleeping additionally to make sure that the server actually is not alive - // and giving it more time to gossip if alive. - Thread.sleep(LoadBroadcaster.BROADCAST_INTERVAL); - } - catch (InterruptedException e) - { - throw new AssertionError(e); - } tokens = new ArrayList<Token>(); - for (String token : DatabaseDescriptor.getReplaceTokens()) - tokens.add(StorageService.getPartitioner().getTokenFactory().fromString(token)); + if (DatabaseDescriptor.getReplaceTokens().size() !=0) + { + for (String token : DatabaseDescriptor.getReplaceTokens()) + tokens.add(StorageService.getPartitioner().getTokenFactory().fromString(token)); + } + else + { + assert DatabaseDescriptor.getReplaceNode() != null; + InetAddress endpoint = tokenMetadata.getEndpointForHostId(DatabaseDescriptor.getReplaceNode()); + if (endpoint == null) + throw new UnsupportedOperationException("Cannot replace host id " + DatabaseDescriptor.getReplaceNode() + " because it does not exist!"); + tokens = tokenMetadata.getTokens(endpoint); + } // check for operator errors... for (Token token : tokens) @@@ -860,8 -919,8 +877,8 @@@ private void bootstrap(Collection<Token> tokens) { isBootstrapMode = true; - SystemTable.updateTokens(tokens); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping + SystemKeyspace.updateTokens(tokens); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping - if (0 == DatabaseDescriptor.getReplaceTokens().size()) + if (DatabaseDescriptor.isReplacing()) { // if not an existing token then bootstrap // order is important here, the gossiper can fire in between adding these two states. It's ok to send TOKENS without STATUS, but *not* vice versa.