Write to pending endpoint when view replica is also base replica

Patch by Paulo Motta; Reviewed by Zhao Yang for CASSANDRA-14251


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c6733898
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c6733898
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c6733898

Branch: refs/heads/cassandra-3.11
Commit: c67338989f17257d3be95212ca6ecb4b83009326
Parents: 85fafd0
Author: Paulo Motta <pauloricard...@gmail.com>
Authored: Wed Feb 21 19:55:41 2018 -0300
Committer: Paulo Motta <pa...@apache.org>
Committed: Tue Mar 6 11:14:18 2018 -0300

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 NEWS.txt                                                | 9 +++++++++
 src/java/org/apache/cassandra/service/StorageProxy.java | 7 +++++--
 3 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c6733898/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9734507..ad558de 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.17
+ * Write to pending endpoint when view replica is also base replica 
(CASSANDRA-14251)
  * Chain commit log marker potential performance regression in batch commit 
mode (CASSANDRA-14194)
  * Fully utilise specified compaction threads (CASSANDRA-14210)
  * Pre-create deletion log records to finish compactions quicker 
(CASSANDRA-12763)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c6733898/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index d282b22..64de28a 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -42,6 +42,15 @@ restore snapshots created with the previous major version 
using the
 'sstableloader' tool. You can upgrade the file format of your snapshots
 using the provided 'sstableupgrade' tool.
 
+3.0.17
+=====
+
+Upgrading
+---------
+    - Materialized view users upgrading from 3.0.15 or later that have 
performed range movements (join, decommission, move, etc),
+      should run repair on the base tables, and subsequently on the views to 
ensure data affected by CASSANDRA-14251 is correctly
+      propagated to all replicas.
+
 3.0.16
 =====
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c6733898/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java 
b/src/java/org/apache/cassandra/service/StorageProxy.java
index e380a3f..7a6bed4 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -759,8 +759,11 @@ public class StorageProxy implements StorageProxyMBean
                         continue;
                     }
 
-                    // When local node is the paired endpoint just apply the 
mutation locally.
-                    if 
(pairedEndpoint.get().equals(FBUtilities.getBroadcastAddress()) && 
StorageService.instance.isJoined())
+                    // When local node is the endpoint we can just apply the 
mutation locally,
+                    // unless there are pending endpoints, in which case we 
want to do an ordinary
+                    // write so the view mutation is sent to the pending 
endpoint
+                    if 
(pairedEndpoint.get().equals(FBUtilities.getBroadcastAddress()) && 
StorageService.instance.isJoined()
+                        && pendingEndpoints.isEmpty())
                         try
                         {
                             mutation.apply(writeCommitLog);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to