phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rajeshbabu (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-1126) Make local index updates transactional with the data updates
Date Tue, 05 Aug 2014 17:48:11 GMT


rajeshbabu commented on PHOENIX-1126:

Here are the high level steps how writes happen in transactional way in hindex.

1) When we do puts/deletes on user table first we prepare index updates in prePut/Delete
2) Acquire locks on both data and index regions (acquire lock on index region through postStartRegionOperation
3) Then write data table puts/deletes to data region memstore(s)
4) write wal edits of both user and index records at time through wal hooks.
5) In postBatchMutate hook write index table puts/deletes to index region memstore(s). at
the end these puts/deletes visible for reading.(this is not a problem because hindex won't
have support to read index table directly).
6) make data region puts/deletes visible for reading.
7) Then release the locks on both data and index regions(release lock on index region through
postCloseRegionOperation hook).

Let's suppose
if we get any failures  
i) before 4th step any way we rollback memstore and release both regions locks so no writes
happen to any region.
ii)While writing the wal edits to log then also we rollback data region memstore(s) so updates
won't happen to any region.
iii)after 4th or 5th step we will retry or abort RS. Since we have written edits of both data
and index updates to log at a time so while replaying both user and index edits will be replayed.


> Make local index updates transactional with the data updates
> ------------------------------------------------------------
>                 Key: PHOENIX-1126
>                 URL:
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: rajeshbabu
> Given that local index updates happen on the same region server as the data updates,
we should be able to make them transaction: either both the data and index updates succeed,
or neither of them do. I seem to remember [~lhofhansl] mentioned that the all or none behavior
of HRegion.mutateRowsWithLocks() could be emulated across tables if you knew that the mutations
were all local.

This message was sent by Atlassian JIRA

View raw message