You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/08/20 01:11:20 UTC
[1/5] git commit: Improve PasswordAuthenticator default super user
setup
Repository: cassandra
Updated Branches:
refs/heads/cassandra-2.1 a37a03632 -> 07185567e
Improve PasswordAuthenticator default super user setup
patch by Aleksey Yeschenko; reviewed by Jeremiah Jordan for
CASSANDRA-7788
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/48d6950c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/48d6950c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/48d6950c
Branch: refs/heads/cassandra-2.1
Commit: 48d6950c181987952a4b05e60f918646445d62f9
Parents: 22a4629
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 02:01:14 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 02:01:14 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 1 +
src/java/org/apache/cassandra/auth/Auth.java | 25 ++++++++----------
.../cassandra/auth/PasswordAuthenticator.java | 27 +++++++++-----------
3 files changed, 24 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48d6950c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9fad7c9..db5fa3a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
1.2.19
+ * Improve PasswordAuthenticator default super user setup (CASSANDRA-7788)
* Remove duplicates from StorageService.getJoiningNodes (CASSANDRA-7478)
* Clone token map outside of hot gossip loops (CASSANDRA-7758)
* Add stop method to EmbeddedCassandraService (CASSANDRA-7595)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48d6950c/src/java/org/apache/cassandra/auth/Auth.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/auth/Auth.java b/src/java/org/apache/cassandra/auth/Auth.java
index 9cee12a..60c87d7 100644
--- a/src/java/org/apache/cassandra/auth/Auth.java
+++ b/src/java/org/apache/cassandra/auth/Auth.java
@@ -38,7 +38,6 @@ import org.apache.cassandra.locator.SimpleStrategy;
import org.apache.cassandra.service.*;
import org.apache.cassandra.transport.messages.ResultMessage;
import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
public class Auth
{
@@ -137,18 +136,15 @@ public class Auth
// the delay is here to give the node some time to see its peers - to reduce
// "Skipped default superuser setup: some nodes were not ready" log spam.
// It's the only reason for the delay.
- if (DatabaseDescriptor.getSeeds().contains(FBUtilities.getBroadcastAddress()) || !DatabaseDescriptor.isAutoBootstrap())
- {
- StorageService.tasks.schedule(new Runnable()
+ StorageService.tasks.schedule(new Runnable()
+ {
+ public void run()
{
- public void run()
- {
- setupDefaultSuperuser();
- }
- },
- SUPERUSER_SETUP_DELAY,
- TimeUnit.MILLISECONDS);
- }
+ setupDefaultSuperuser();
+ }
+ },
+ SUPERUSER_SETUP_DELAY,
+ TimeUnit.MILLISECONDS);
try
{
@@ -213,7 +209,7 @@ public class Auth
USERS_CF,
DEFAULT_SUPERUSER_NAME,
true),
- ConsistencyLevel.QUORUM);
+ ConsistencyLevel.ONE);
logger.info("Created default superuser '{}'", DEFAULT_SUPERUSER_NAME);
}
}
@@ -228,7 +224,8 @@ public class Auth
// Try looking up the 'cassandra' default super user first, to avoid the range query if possible.
String defaultSUQuery = String.format("SELECT * FROM %s.%s WHERE name = '%s'", AUTH_KS, USERS_CF, DEFAULT_SUPERUSER_NAME);
String allUsersQuery = String.format("SELECT * FROM %s.%s LIMIT 1", AUTH_KS, USERS_CF);
- return !QueryProcessor.process(defaultSUQuery, ConsistencyLevel.QUORUM).isEmpty()
+ return !QueryProcessor.process(defaultSUQuery, ConsistencyLevel.ONE).isEmpty()
+ || !QueryProcessor.process(defaultSUQuery, ConsistencyLevel.QUORUM).isEmpty()
|| !QueryProcessor.process(allUsersQuery, ConsistencyLevel.QUORUM).isEmpty();
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/48d6950c/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
index 9adbe4e..dfe7275 100644
--- a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
+++ b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
@@ -27,7 +27,6 @@ import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.config.Schema;
import org.apache.cassandra.cql3.UntypedResultSet;
import org.apache.cassandra.cql3.QueryProcessor;
@@ -39,7 +38,6 @@ import org.apache.cassandra.service.QueryState;
import org.apache.cassandra.service.StorageService;
import org.apache.cassandra.transport.messages.ResultMessage;
import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
import org.mindrot.jbcrypt.BCrypt;
/**
@@ -169,18 +167,15 @@ public class PasswordAuthenticator implements IAuthenticator
// the delay is here to give the node some time to see its peers - to reduce
// "skipped default user setup: some nodes are were not ready" log spam.
// It's the only reason for the delay.
- if (DatabaseDescriptor.getSeeds().contains(FBUtilities.getBroadcastAddress()) || !DatabaseDescriptor.isAutoBootstrap())
- {
- StorageService.tasks.schedule(new Runnable()
+ StorageService.tasks.schedule(new Runnable()
+ {
+ public void run()
{
- public void run()
- {
- setupDefaultUser();
- }
- },
- Auth.SUPERUSER_SETUP_DELAY,
- TimeUnit.MILLISECONDS);
- }
+ setupDefaultUser();
+ }
+ },
+ Auth.SUPERUSER_SETUP_DELAY,
+ TimeUnit.MILLISECONDS);
try
{
@@ -224,7 +219,7 @@ public class PasswordAuthenticator implements IAuthenticator
CREDENTIALS_CF,
DEFAULT_USER_NAME,
escape(hashpw(DEFAULT_USER_PASSWORD))),
- ConsistencyLevel.QUORUM);
+ ConsistencyLevel.ONE);
logger.info("PasswordAuthenticator created default user '{}'", DEFAULT_USER_NAME);
}
}
@@ -239,7 +234,9 @@ public class PasswordAuthenticator implements IAuthenticator
// Try looking up the 'cassandra' default user first, to avoid the range query if possible.
String defaultSUQuery = String.format("SELECT * FROM %s.%s WHERE username = '%s'", Auth.AUTH_KS, CREDENTIALS_CF, DEFAULT_USER_NAME);
String allUsersQuery = String.format("SELECT * FROM %s.%s LIMIT 1", Auth.AUTH_KS, CREDENTIALS_CF);
- return !process(defaultSUQuery, ConsistencyLevel.QUORUM).isEmpty() || !process(allUsersQuery, ConsistencyLevel.QUORUM).isEmpty();
+ return !process(defaultSUQuery, ConsistencyLevel.ONE).isEmpty()
+ || !process(defaultSUQuery, ConsistencyLevel.QUORUM).isEmpty()
+ || !process(allUsersQuery, ConsistencyLevel.QUORUM).isEmpty();
}
private static String hashpw(String password)
[3/5] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Posted by al...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1
Conflicts:
CHANGES.txt
src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5df5f32a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5df5f32a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5df5f32a
Branch: refs/heads/cassandra-2.1
Commit: 5df5f32af53dec1ed29869a4afbf3e48f86af1a6
Parents: a37a036 31d5193
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 02:09:45 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 02:09:45 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 2 ++
src/java/org/apache/cassandra/auth/Auth.java | 25 ++++++++----------
.../cassandra/auth/PasswordAuthenticator.java | 27 +++++++++-----------
3 files changed, 25 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5df5f32a/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 6facab9,1de5b33..1102946
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -26,45 -13,6 +26,47 @@@ Merged from 2.0
* (Hadoop) Add CqlOutputFormat (CASSANDRA-6927)
* Don't depend on cassandra config for nodetool ring (CASSANDRA-7508)
* (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)
+ * Fix IncompatibleClassChangeError from hadoop2 (CASSANDRA-7229)
+ * Add 'nodetool sethintedhandoffthrottlekb' (CASSANDRA-7635)
+ * (cqlsh) Add tab-completion for CREATE/DROP USER IF [NOT] EXISTS (CASSANDRA-7611)
+ * Catch errors when the JVM pulls the rug out from GCInspector (CASSANDRA-5345)
+ * cqlsh fails when version number parts are not int (CASSANDRA-7524)
++Merged from 1.2:
++ * Improve PasswordAuthenticator default super user setup (CASSANDRA-7788)
+
+
+2.1.0
+ * (cqlsh) Fix COPY FROM handling of null/empty primary key
+ values (CASSANDRA-7792)
+ * Fix ordering of static cells (CASSANDRA-7763)
+Merged from 2.0:
+ * Fix PRSI handling of CQL3 row markers for row cleanup (CASSANDRA-7787)
+ * Fix dropping collection when it's the last regular column (CASSANDRA-7744)
+ * Properly reject operations on list index with conditions (CASSANDRA-7499)
+
+
+2.1.0-rc6
+ * Fix OOM issue from netty caching over time (CASSANDRA-7743)
+ * json2sstable couldn't import JSON for CQL table (CASSANDRA-7477)
+ * Invalidate all caches on table drop (CASSANDRA-7561)
+ * Skip strict endpoint selection for ranges if RF == nodes (CASSANRA-7765)
+ * Fix Thrift range filtering without 2ary index lookups (CASSANDRA-7741)
+ * Add tracing entries about concurrent range requests (CASSANDRA-7599)
+ * (cqlsh) Fix DESCRIBE for NTS keyspaces (CASSANDRA-7729)
+ * Remove netty buffer ref-counting (CASSANDRA-7735)
+ * Pass mutated cf to index updater for use by PRSI (CASSANDRA-7742)
+ * Include stress yaml example in release and deb (CASSANDRA-7717)
+ * workaround for netty issue causing corrupted data off the wire (CASSANDRA-7695)
+ * cqlsh DESC CLUSTER fails retrieving ring information (CASSANDRA-7687)
+ * Fix binding null values inside UDT (CASSANDRA-7685)
+ * Fix UDT field selection with empty fields (CASSANDRA-7670)
+ * Bogus deserialization of static cells from sstable (CASSANDRA-7684)
+ * Fix NPE on compaction leftover cleanup for dropped table (CASSANDRA-7770)
+Merged from 2.0:
+ * (cqlsh) Wait up to 10 sec for a tracing session (CASSANDRA-7222)
+ * Fix NPE in FileCacheService.sizeInBytes (CASSANDRA-7756)
+ * Remove duplicates from StorageService.getJoiningNodes (CASSANDRA-7478)
+ * Clone token map outside of hot gossip loops (CASSANDRA-7758)
* Fix MS expiring map timeout for Paxos messages (CASSANDRA-7752)
* Do not flush on truncate if durable_writes is false (CASSANDRA-7750)
* Give CRR a default input_cql Statement (CASSANDRA-7226)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5df5f32a/src/java/org/apache/cassandra/auth/Auth.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/5df5f32a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
index 72c86e6,e4c00b7..1218ee2
--- a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
+++ b/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
@@@ -30,7 -30,7 +30,6 @@@ import org.apache.commons.lang3.StringU
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
- import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.Schema;
import org.apache.cassandra.cql3.UntypedResultSet;
import org.apache.cassandra.cql3.QueryProcessor;
import org.apache.cassandra.cql3.QueryOptions;
[4/5] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1.0
Posted by al...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1.0
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/18112812
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/18112812
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/18112812
Branch: refs/heads/cassandra-2.1
Commit: 18112812495ecb818c6eca312ed41c1d44063401
Parents: 94262c4 31d5193
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 02:10:06 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 02:10:06 2014 +0300
----------------------------------------------------------------------
----------------------------------------------------------------------
[5/5] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1
Posted by al...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/07185567
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/07185567
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/07185567
Branch: refs/heads/cassandra-2.1
Commit: 07185567e80d58ac2acc91db573576d0194068c7
Parents: 5df5f32 1811281
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 02:11:04 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 02:11:04 2014 +0300
----------------------------------------------------------------------
----------------------------------------------------------------------
[2/5] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Posted by al...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0
Conflicts:
CHANGES.txt
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/31d5193a
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/31d5193a
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/31d5193a
Branch: refs/heads/cassandra-2.1
Commit: 31d5193a7ab73d6dfaa2ec2367c24296755c5584
Parents: 296903b 48d6950
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 02:05:17 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 02:05:17 2014 +0300
----------------------------------------------------------------------
CHANGES.txt | 1 +
src/java/org/apache/cassandra/auth/Auth.java | 25 ++++++++----------
.../cassandra/auth/PasswordAuthenticator.java | 27 +++++++++-----------
3 files changed, 24 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31d5193a/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index de45376,db5fa3a..1de5b33
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,62 -1,5 +1,63 @@@
-1.2.19
+2.0.10
+ * Throw InvalidRequestException when queries contain relations on entire
+ collection columns (CASSANDRA-7506)
+ * Fix PRSI handling of CQL3 row markers for row cleanup (CASSANDRA-7787)
+ * (cqlsh) enable CTRL-R history search with libedit (CASSANDRA-7577)
+ * Fix dropping collection when it's the last regular column (CASSANDRA-7744)
+ * Properly reject operations on list index with conditions (CASSANDRA-7499)
+ * (Hadoop) allow ACFRW to limit nodes to local DC (CASSANDRA-7252)
+ * (cqlsh) Wait up to 10 sec for a tracing session (CASSANDRA-7222)
+ * Fix NPE in FileCacheService.sizeInBytes (CASSANDRA-7756)
+ * (cqlsh) cqlsh should automatically disable tracing when selecting
+ from system_traces (CASSANDRA-7641)
+ * (Hadoop) Add CqlOutputFormat (CASSANDRA-6927)
+ * Don't depend on cassandra config for nodetool ring (CASSANDRA-7508)
+ * (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)
+ * Fix MS expiring map timeout for Paxos messages (CASSANDRA-7752)
+ * Do not flush on truncate if durable_writes is false (CASSANDRA-7750)
+ * Give CRR a default input_cql Statement (CASSANDRA-7226)
+ * Better error message when adding a collection with the same name
+ than a previously dropped one (CASSANDRA-6276)
+ * Fix validation when adding static columns (CASSANDRA-7730)
+ * (Thrift) fix range deletion of supercolumns (CASSANDRA-7733)
+ * Fix potential AssertionError in RangeTombstoneList (CASSANDRA-7700)
+ * Validate arguments of blobAs* functions (CASSANDRA-7707)
+ * Fix potential AssertionError with 2ndary indexes (CASSANDRA-6612)
+ * Avoid logging CompactionInterrupted at ERROR (CASSANDRA-7694)
+ * Minor leak in sstable2jon (CASSANDRA-7709)
+ * Add cassandra.auto_bootstrap system property (CASSANDRA-7650)
+ * Remove CqlPagingRecordReader/CqlPagingInputFormat (CASSANDRA-7570)
+ * Fix IncompatibleClassChangeError from hadoop2 (CASSANDRA-7229)
+ * Add 'nodetool sethintedhandoffthrottlekb' (CASSANDRA-7635)
+ * Update java driver (for hadoop) (CASSANDRA-7618)
+ * Fix truncate to always flush (CASSANDRA-7511)
+ * Remove shuffle and taketoken (CASSANDRA-7601)
+ * Switch liveRatio-related log messages to DEBUG (CASSANDRA-7467)
+ * (cqlsh) Add tab-completion for CREATE/DROP USER IF [NOT] EXISTS (CASSANDRA-7611)
+ * Always merge ranges owned by a single node (CASSANDRA-6930)
+ * Pig support for hadoop CqlInputFormat (CASSANDRA-6454)
+ * Fix ReversedType(DateType) mapping to native protocol (CASSANDRA-7576)
+ * (Windows) force range-based repair to non-sequential mode (CASSANDRA-7541)
+ * Fix range merging when DES scores are zero (CASSANDRA-7535)
+ * Warn when SSL certificates have expired (CASSANDRA-7528)
+ * Workaround JVM NPE on JMX bind failure (CASSANDRA-7254)
+ * Fix race in FileCacheService RemovalListener (CASSANDRA-7278)
+ * Fix inconsistent use of consistencyForCommit that allowed LOCAL_QUORUM
+ operations to incorrect become full QUORUM (CASSANDRA-7345)
+ * Properly handle unrecognized opcodes and flags (CASSANDRA-7440)
+ * (Hadoop) close CqlRecordWriter clients when finished (CASSANDRA-7459)
+ * Make sure high level sstables get compacted (CASSANDRA-7414)
+ * Fix AssertionError when using empty clustering columns and static columns
+ (CASSANDRA-7455)
+ * Add inter_dc_stream_throughput_outbound_megabits_per_sec (CASSANDRA-6596)
+ * Add option to disable STCS in L0 (CASSANDRA-6621)
+ * Fix error when doing reversed queries with static columns (CASSANDRA-7490)
+ * Backport CASSNADRA-3569/CASSANDRA-6747 (CASSANDRA-7560)
+ * Track max/min timestamps for range tombstones (CASSANDRA-7647)
+ * Fix NPE when listing saved caches dir (CASSANDRA-7632)
+ * Fix sstableloader unable to connect encrypted node (CASSANDRA-7585)
+Merged from 1.2:
+ * Improve PasswordAuthenticator default super user setup (CASSANDRA-7788)
* Remove duplicates from StorageService.getJoiningNodes (CASSANDRA-7478)
* Clone token map outside of hot gossip loops (CASSANDRA-7758)
* Add stop method to EmbeddedCassandraService (CASSANDRA-7595)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31d5193a/src/java/org/apache/cassandra/auth/Auth.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/31d5193a/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java
----------------------------------------------------------------------