cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6572) Workload recording / playback
Date Sat, 10 May 2014 21:56:24 GMT


Benedict commented on CASSANDRA-6572:

Points 1 and 2 need to be atomic, so you calculate how much room you need, then in a loop
you get the current value of the queue pointer, check there is room in the queue for the record,
and then cas the current value to the new value (old + size). If it succeeds you exit the
loop and then you can write to the buffer. No need to offload to another thread. The flush
needs to make sure that all prior appends have finished before flushing though, and the best
way to do this is with an OpOrder. See CommitLogSegment for examples. The appends would do
something like:

OpOrder.Group opGroup = order.start();
 int size = calcSize();
 QueryQueue q; 
 int position;
 while (true)
  int position = q.currentPosition
  if (position + size < q.buffer.length && q.currentPosition.compareAndSet(position,
position + size))
 doAppend(q, position);

and the flush would do something like

        OpOrder.Barrier barrier = order.newBarrier();

> Workload recording / playback
> -----------------------------
>                 Key: CASSANDRA-6572
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core, Tools
>            Reporter: Jonathan Ellis
>            Assignee: Lyuben Todorov
>             Fix For: 2.1.1
>         Attachments: 6572-trunk.diff
> "Write sample mode" gets us part way to testing new versions against a real world workload,
but we need an easy way to test the query side as well.

This message was sent by Atlassian JIRA

View raw message