Compare commits

...

13 Commits

Author SHA1 Message Date
Pekka Enberg
79865c2d2e release: prepare for 1.0.4 2016-05-29 10:39:22 +03:00
Pekka Enberg
4fdec13281 release: prepare for 1.0.3 2016-05-02 14:29:41 +03:00
Pekka Enberg
0732b76b33 release: prepare for 1.0.2 2016-04-20 22:11:20 +03:00
Takuya ASADA
955dc16a31 dist: do not auto-start scylla-server job on Ubuntu package install time
Same as f1d18e9980
Fixes scylladb/scylla#1134

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1459346746-3433-1-git-send-email-syuu@scylladb.com>
(cherry picked from commit 0c5c1debde580dc0e1f176c184162057387837ba)
2016-04-12 15:15:11 +03:00
Pekka Enberg
3d39ece41f release: prepare for 1.0.1 2016-04-09 19:21:53 +03:00
Pekka Enberg
295f925860 release: prepare for 1.0.0 2016-03-30 12:20:08 +03:00
Pekka Enberg
f014f82630 release: prepare for 1.0.rc3 2016-03-29 16:23:31 +03:00
Pekka Enberg
11e5421d4b release: prepare for 1.0.rc2 2016-03-27 10:20:21 +03:00
Pekka Enberg
46286836e4 release: prepare for 1.0.rc1 2016-03-22 12:27:27 +02:00
Pekka Enberg
ed493ef1d1 dist/ubuntu: Use tilde for release candidate builds
The version number ordering rules are different for rpm and deb. Use
tilde ('~') for the latter to ensure a release candidate is ordered
_before_ a final version.

(cherry picked from commit 524763cfeda89c9f9998c015ed1ad2ee8fb0e9ad)
2016-03-22 12:25:15 +02:00
Amnon Heiman
080042318e ProcessingException was changed to IllegalStateException
This patch fix the exception handling for connection problem, instead of
ProcessingException it now expect IllegalStateException.

The rest of the functionality remains the same.

Fixes #26

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1458602355-23601-1-git-send-email-amnon@scylladb.com>
(cherry picked from commit 8f90d413a1f93b2d518688010f1cc0682f57dc2e)
2016-03-22 08:55:45 +02:00
Pekka Enberg
9718d87e80 StorageService: Fix scrub() variant API wiring
The 'nodetool scrub' command ends up calling the variant that is not
wired up to the Scylla API which causes the following error to be
printed out to the user:

  [penberg@nero scylla-tools-java]$ ./bin/nodetool scrub
  error: For input string: ""
  -- StackTrace --
  java.lang.NumberFormatException: For input string: ""
          at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
          at java.lang.Integer.parseInt(Integer.java:592)
          at java.lang.Integer.parseInt(Integer.java:615)
          at com.scylladb.jmx.api.APIClient.getIntValue(APIClient.java:216)
          at com.scylladb.jmx.api.APIClient.getIntValue(APIClient.java:220)
          at org.apache.cassandra.service.StorageService.scrub(StorageService.java:1291)

Fix the problem by implementing the said scrub() variant.
Message-Id: <1458035736-26349-1-git-send-email-penberg@scylladb.com>

(cherry picked from commit 2cd5a5f0487d95c908f60005945fed839ee01a53)
2016-03-16 11:34:59 +02:00
Pekka Enberg
9c9d879a48 APIClient: Make API server errors human readable
Make the error messages returned by Scylla API server human readable
from 'nodetool'.

For example, if an API URL is missing, print out the following error:

  [penberg@nero scylla-tools-java]$ ./bin/nodetool getcompactionthreshold ks test4
  nodetool: Scylla API server HTTP GET to URL 'column_family/minimum_compaction/ks:test4' failed: Not found
  See 'nodetool help' or 'nodetool help <command>'.

instead of the scary-looking error that we now print:

  [penberg@nero scylla-tools-java]$ ./bin/nodetool getcompactionthreshold ks test4
  error: Not found
  -- StackTrace --
  java.lang.RuntimeException: Not found
          at com.scylladb.jmx.api.APIClient.getException(APIClient.java:116)
          at com.scylladb.jmx.api.APIClient.getRawValue(APIClient.java:160)
          at com.scylladb.jmx.api.APIClient.getRawValue(APIClient.java:174)
          at com.scylladb.jmx.api.APIClient.getIntValue(APIClient.java:216)
          at com.scylladb.jmx.api.APIClient.getIntValue(APIClient.java:220)
          at org.apache.cassandra.db.ColumnFamilyStore.getMinimumCompactionThreshold(ColumnFamilyStore.java:475)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          [snip]
Message-Id: <1458032300-17704-1-git-send-email-penberg@scylladb.com>

(cherry picked from commit c4d8d7087e342085dcff854f4dbcd42db07a5f4d)
2016-03-16 11:34:49 +02:00
7 changed files with 24 additions and 26 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
VERSION=666.development
VERSION=1.0.4
if test -f version
then

View File

@ -10,7 +10,7 @@ if [ -e debian ] || [ -e build ] || [ -e target ] || [ -e m2 ] || [ -e dependenc
fi
VERSION=$(./SCYLLA-VERSION-GEN)
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE)
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE | sed 's/\.rc/~rc/')
SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
if [ "$SCYLLA_VERSION" = "development" ]; then
SCYLLA_VERSION=0development

View File

@ -23,5 +23,8 @@ override_dh_auto_install:
cp $(CURDIR)/scripts/scylla-jmx $(DEST)
cp $(CURDIR)/target/scylla-jmx-1.0.jar $(DEST)
override_dh_installinit:
dh_installinit --no-start
%:
dh $@

View File

@ -100,7 +100,7 @@ public class APIClient {
public Response post(String path, MultivaluedMap<String, String> queryParams) {
Response response = get(path, queryParams).post(Entity.entity(null, MediaType.TEXT_PLAIN));
if (response.getStatus() != Response.Status.OK.getStatusCode() ) {
throw getException(response.readEntity(String.class));
throw getException("Scylla API server HTTP POST to URL '" + path + "' failed", response.readEntity(String.class));
}
return response;
@ -110,10 +110,10 @@ public class APIClient {
post(path, null);
}
public RuntimeException getException(String txt) {
JsonReader reader = factory.createReader(new StringReader(txt));
public IllegalStateException getException(String msg, String json) {
JsonReader reader = factory.createReader(new StringReader(json));
JsonObject res = reader.readObject();
return new RuntimeException(res.getString("message"));
return new IllegalStateException(msg + ": " + res.getString("message"));
}
public String postGetVal(String path, MultivaluedMap<String, String> queryParams) {
@ -157,7 +157,7 @@ public class APIClient {
// TBD
// We are currently not caching errors,
// it should be reconsider.
throw getException(response.readEntity(String.class));
throw getException("Scylla API server HTTP GET to URL '" + string + "' failed", response.readEntity(String.class));
}
res = response.readEntity(String.class);
if (duration > 0) {

View File

@ -132,14 +132,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
}
}
missed_response = 0;
} catch (ProcessingException e) {
if (Throwables.getRootCause(e) instanceof ConnectException) {
if (missed_response++ > MAX_RETRY) {
System.err.println("API is not available, JMX is shuting down");
System.exit(-1);
}
} else {
// ignoring exceptions, will retry on the next interval
} catch (IllegalStateException e) {
if (missed_response++ > MAX_RETRY) {
System.err.println("API is not available, JMX is shuting down");
System.exit(-1);
}
} catch (Exception e) {
// ignoring exceptions, will retry on the next interval

View File

@ -138,7 +138,7 @@ public final class MessagingService implements MessagingServiceMBean {
}
connection_failure = 0;
report_error = 1;
} catch (ProcessingException e) {
} catch (IllegalStateException e) {
// Connection problem, No need to do anything, just retry.
} catch (Exception e) {
connection_failure++;

View File

@ -549,6 +549,15 @@ public class StorageService extends NotificationBroadcasterSupport
String keyspaceName, String... columnFamilies) throws IOException,
ExecutionException, InterruptedException {
log(" scrub(boolean disableSnapshot, boolean skipCorrupted, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
return scrub(disableSnapshot, skipCorrupted, true, keyspaceName, columnFamilies);
}
@Override
public int scrub(boolean disableSnapshot, boolean skipCorrupted,
boolean checkData, String keyspaceName, String... columnFamilies)
throws IOException, ExecutionException,
InterruptedException {
log(" scrub(boolean disableSnapshot, boolean skipCorrupted, bool checkData, String keyspaceName, String... columnFamilies) throws IOException, ExecutionException, InterruptedException");
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
APIClient.set_bool_query_param(queryParams, "disable_snapshot",
disableSnapshot);
@ -1281,16 +1290,6 @@ public class StorageService extends NotificationBroadcasterSupport
log(" takeMultipleColumnFamilySnapshot");
}
@Override
public int scrub(boolean disableSnapshot, boolean skipCorrupted,
boolean checkData, String keyspaceName, String... columnFamilies)
throws IOException, ExecutionException,
InterruptedException {
// TODO Auto-generated method stub
log(" scrub()");
return c.getIntValue("");
}
@Override
public int forceRepairAsync(String keyspace, int parallelismDegree,
Collection<String> dataCenters, Collection<String> hosts,