cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Motta (JIRA)" <>
Subject [jira] [Updated] (CASSANDRA-13762) Ensure views created during (or just before) range movements are properly built
Date Fri, 05 Jan 2018 12:00:02 GMT


Paulo Motta updated CASSANDRA-13762:
    Status: Patch Available  (was: Open)

The problem in this ticket description is reproduced by this [dtest|].

The fix consists in applying the optimization from CASSANDRA-13065 only if the source node
has built all the views from the streamed base table. Otherwise, the mutations are sent through
the write path as it was done before.

In order to check if a source node has built all views we need to query the {{system_distrbuted.view_build_status}}
table. Querying this table on a bootstrapping node was [previously throwing|]
{{IsBootstrappingException}}, but I didn't find any good reason for this limitation, so I
lifted it [here|].

One problem that arises when sending mutations through the write path during bootstrap is
that the views are not propagated to replicas, but [written to the batchlog|]
so the views may not be fully available when the node finishes bootstrapping, even though
they are [marked as built|].
This is the same problem described on CASSANDRA-13629. 

The fix to the problem above is to [wait for batchlog replay|]
before finishing bootstrap if views are present (we should probably reopen CASSANDRA-13629
and backport this fix btw). One downside of this approach is that we need to [wait for the
batchlog timeout|]
to ensure all batchlogs are replayed, what should increase the bootstrap in tens of seconds,
but should be acceptable. If necessary we can try to raise this limitation in another ticket.

I also added a dtest to check that view rebuild is skipped during streaming if the source
node has built the views ([here|]).

Patch and tests below (CI looks good):


> Ensure views created during (or just before) range movements are properly built
> -------------------------------------------------------------------------------
>                 Key: CASSANDRA-13762
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Materialized Views
>            Reporter: Paulo Motta
>            Assignee: Paulo Motta
>            Priority: Minor
>              Labels: materializedviews
>         Attachments: trunk-13762-dtest.png, trunk-13762-testall.png
> CASSANDRA-13065 assumes the source node has its views built to skip running base mutations
through the write path during range movements.
> It is possible that the source node has not finished building the view, or that a new
view is created during a range movement, in which case the view may be wrongly marked as built
on the destination node.
> The former problem was introduced by #13065, but even before that a view created during
a range movement may not be correctly built on the destination node because the view builder
will be triggered before it has finished streaming the source data, wrongly marking the view
as built on that node.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message