Permalink
Browse files

Don't try to deliver hints when there isn't any

patch by jbellis; reviewed by slebresne for CASSANDRA-3176


git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-1.0.0@1178012 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 124ac28 commit b42139c41abb17ffffd99b960adb73d3f9599fd9 @pcmanus pcmanus committed Oct 1, 2011
Showing with 6 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +5 −1 src/java/org/apache/cassandra/db/HintedHandOffManager.java
View
@@ -15,6 +15,7 @@
* ignore any CF ids sent by client for adding CF/KS (CASSANDRA-3288)
* remove obsolete hints on first startup (CASSANDRA-3291)
* use correct ISortedColumns for time-optimized reads (CASSANDRA-3289)
+ * don't try delivering hints if when there isn't any (CASSANDRA-3176)
1.0.0-rc1
@@ -225,6 +225,10 @@ private int waitForSchemaAgreement(InetAddress endpoint) throws InterruptedExcep
private void deliverHintsToEndpoint(InetAddress endpoint) throws IOException, DigestMismatchException, InvalidRequestException, TimeoutException, InterruptedException
{
+ ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF);
+ if (hintStore.getSSTables().isEmpty())
+ return; // nothing to do, don't confuse users by logging a no-op handoff
+
try
{
logger_.debug("Checking remote({}) schema before delivering hints", endpoint);
@@ -260,7 +264,6 @@ private void deliverHintsToEndpoint(InetAddress endpoint) throws IOException, Di
ByteBuffer tokenBytes = StorageService.getPartitioner().getTokenFactory().toByteArray(token);
DecoratedKey<?> epkey = StorageService.getPartitioner().decorateKey(tokenBytes);
int rowsReplayed = 0;
- ColumnFamilyStore hintStore = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(HINTS_CF);
ByteBuffer startColumn = ByteBufferUtil.EMPTY_BYTE_BUFFER;
delivery:
@@ -323,6 +326,7 @@ private void deliverHintsToEndpoint(InetAddress endpoint) throws IOException, Di
*/
public void deliverHints(final InetAddress to)
{
+ logger_.debug("deliverHints to {}", to);
if (!queuedDeliveries.add(to))
return;

0 comments on commit b42139c

Please sign in to comment.