Skip to content

Commit

Permalink
Merge branch 'cassandra-3.0' into cassandra-3.X
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefania Alborghetti committed Oct 4, 2016
2 parents c089b26 + 5115c10 commit 2e18adf
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 137 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
* Remove compaction Severity from DynamicEndpointSnitch (CASSANDRA-11738)
* Restore resumable hints delivery (CASSANDRA-11960)
Merged from 3.0:
* Unify drain and shutdown processes (CASSANDRA-12509)
* Fix NPE in ComponentOfSlice.isEQ() (CASSANDRA-12706)
* Fix failure in LogTransactionTest (CASSANDRA-12632)
* Fix potentially incomplete non-frozen UDT values when querying with the
Expand Down
3 changes: 2 additions & 1 deletion conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ appender reference in the root level section below.

<configuration scan="true">
<jmxConfigurator />
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>

<!-- No shutdown hook; we run it ourselves in StorageService after shutdown -->

<!-- SYSTEMLOG rolling file appender to system.log (INFO level) -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void rejectedExecution(Runnable task, ThreadPoolExecutor executor)
{
if (executor.isShutdown())
{
if (!StorageService.instance.isInShutdownHook())
if (!StorageService.instance.isShutdown())
throw new RejectedExecutionException("ScheduledThreadPoolExecutor has shut down.");

//Give some notification to the caller the task isn't going to run
Expand Down
8 changes: 7 additions & 1 deletion src/java/org/apache/cassandra/service/StorageProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,13 @@ public boolean getHintedHandoffEnabled()

public void setHintedHandoffEnabled(boolean b)
{
DatabaseDescriptor.setHintedHandoffEnabled(b);
synchronized (StorageService.instance)
{
if (b)
StorageService.instance.checkServiceAllowedToStart("hinted handoff");

DatabaseDescriptor.setHintedHandoffEnabled(b);
}
}

public void enableHintsForDC(String dc)
Expand Down
285 changes: 153 additions & 132 deletions src/java/org/apache/cassandra/service/StorageService.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ public interface StorageServiceMBean extends NotificationEmitter
// allows a node that have been started without joining the ring to join it
public void joinRing() throws IOException;
public boolean isJoined();
public boolean isDrained();
public boolean isDraining();

public void setRpcTimeout(long value);
public long getRpcTimeout();
Expand Down
10 changes: 10 additions & 0 deletions src/java/org/apache/cassandra/tools/NodeProbe.java
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,16 @@ public boolean isJoined()
return ssProxy.isJoined();
}

public boolean isDrained()
{
return ssProxy.isDrained();
}

public boolean isDraining()
{
return ssProxy.isDraining();
}

public void joinRing() throws IOException
{
ssProxy.joinRing();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2331,7 +2331,7 @@ public void testSecurityPermissions() throws Throwable
'}'},
{"org.apache.cassandra.service.StorageService",
"try {" +
" org.apache.cassandra.service.StorageService v = org.apache.cassandra.service.StorageService.instance; v.isInShutdownHook(); return 0d;" +
" org.apache.cassandra.service.StorageService v = org.apache.cassandra.service.StorageService.instance; v.isShutdown(); return 0d;" +
"} catch (Exception t) {" +
" throw new RuntimeException(t);" +
'}'},
Expand Down Expand Up @@ -2371,7 +2371,7 @@ public void testSecurityPermissions() throws Throwable
"RETURNS NULL ON NULL INPUT " +
"RETURNS double " +
"LANGUAGE javascript\n" +
"AS 'org.apache.cassandra.service.StorageService.instance.isInShutdownHook(); 0;';");
"AS 'org.apache.cassandra.service.StorageService.instance.isShutdown(); 0;';");
execute("SELECT " + fName + "(dval) FROM %s WHERE key=1");
Assert.fail("Javascript security check failed");
}
Expand Down

0 comments on commit 2e18adf

Please sign in to comment.