Hi everybody,

 

I have a question about the MinorDeltaCompationOp. 

In my opinion, the data in redo delta file is in order by row_idx. And at
the same time there is a tree for mapping row_idx to block pointer(ptr). Is
it right?

 

Now, I am reading the code about MinorDeltaCompationOp, especially the
function ‘WriteDeltaIteratorToFile’, I find an interesting thing. The new
redo delta file will be disordered.

1.prepare n rows in every input redo delta file: 

RETURN_NOT_OK(iter->PrepareBatch(n, DeltaIterator::PREPARE_FOR_COLLECT));

 

2.filter and collect these rows, and sort them by deltakey:

RETURN_NOT_OK(iter->FilterColumnIdsAndCollectDeltas(vector<ColumnId>(),

                                                        &cells,

                                                        &arena));

 

3.write them to new redo delta file one by one:

for (const DeltaKeyAndUpdate& cell : cells) {

  RowChangeList rcl(cell.cell);

  RETURN_NOT_OK(out->AppendDelta<Type>(cell.key, rcl));

  RETURN_NOT_OK(stats.UpdateStats(cell.key.timestamp(), rcl));

}

 

4.next loop.

 

Well, my question is that the second n rows in input redo delta file A is
not always larger than the first n rows in input redo delta file B. Thus, it
will result in failure when MutateRow.

 

 

何李夫

2017-04-10 16:06:24

 

Reply via email to