[ 
https://issues.apache.org/jira/browse/CASSANDRA-18519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17721916#comment-17721916
 ] 

David Capwell commented on CASSANDRA-18519:
-------------------------------------------

Update:

I have the following working

1) when we see a range command, update its state into a IntervalTree at the end 
of the operation*
2) when we create a AccordCommandStore load the range commands from the 
commands table; block all processing until this is done

Next:
* In loader, when we see a range command, walk the CommandsForKeys table to 
find all keys to include in the context.
* Update the mapReduce functions to work with range commands using the interval 
map
* Testing on the Cassandra side

Notes:
* our range include/exclude may not match the interval tree; need to validate 
this... so there maybe issues with specific keys due to this... but core logic 
is there

> CEP-15: (C*) Add notion of CommandsForRanges and make this durable in C*
> ------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18519
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18519
>             Project: Cassandra
>          Issue Type: Task
>          Components: Accord
>            Reporter: David Capwell
>            Assignee: David Capwell
>            Priority: Normal
>             Fix For: 5.x
>
>
> To add support for range transactions in C* we need to make sure
> 1) their state is durable and can be recovered on restart
> 2) have some way to find all CommandsForKey that are contained in the range 
> transaction range
> 3) have some way to find all CommandsForRange that intersect this range
> To do this, I propose the following
> 1) Create a new commands_for_range table that stores: (store, range) -> 
> list<accord_timestamp_tuple> — this is byId, not sure if repair needs 
> byExecuteId as well
> 2) For C*, store a in-memory mapping of Range -> List<TxnId>, and on-boot 
> repopulate this cache.  This then can be used to construct the 
> CommandsForRange needed by the transaction. This makes an assumption that 
> many ranges will not exist, at least for the time being.
> 3) Change commands_for_keys to use LocalPartitioner, and order the table by 
> (store, key)
> 4) When C* sees a range transaction, find all keys that are contained by the 
> range by running the logical query "SELECT key FROM commands_for_keys WHERE 
> key BETWEEN range.start AND range.end". Implementation has to make sure to 
> handle many keys (may need to partition the range to increase parallel 
> access, and may need to page through the table to see all keys (aka multiple 
> ReadCommands)).  Once all keys are found, then must load into the 
> CommandsForKeys cache
> For #4, https://github.com/apache/cassandra-accord/pull/27 maybe able to 
> optimize the logic to lazy load only what is actually needed rather than load 
> the whole world



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to