Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-139

Timestamps are being ignored on missed deltas and missed delta replay might be broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • M3
    • None
    • tablet
    • None

    Description

      This is close to KUDU-138 but even hairier.

      We're ignoring the timestamps on the mutations stored as missed deltas (both for r/w). While this is a problem in itself a worse problem is that we have no good way to restore snapshot order on replay even if we did have the timestamps.

      In particular missed delta mutations have the timestamp of the original mutation that created them, but because they are stored out-of-order in the log when we replay there is no guarantee that we apply them before any other mutation that mutates the same rows.

      To solve this we need to both store the timestamps and keep them on replay and we need to enforce the correct ordering of mutations even if missed deltas come in the log after a transactions that followed them in the tablet.

      Illustration

      Base->mut1->|flush snap|mut2->|phase 2 snap|mut3

      So mutation 1 was merged with the base (or transformed into an UNDO) mutation 2 will be a missed delta and mutation 3 is some other mutation.

      assuming each mutation is its own write in the log we might get

      W1,W2,MD,W3

      on replay we ignore W1 which is in fact flushed, ignore W2 'cause we think it is flushed (even though it isn't) , restore mut2 though MD and then replay mut3 and we get

      Base->mut2->mut3 which is correct

      However missed delta ordering is not enforced in the log, so instead of W1,W2,MD,W3 we might get:

      W1,W2,W3,MD

      On replay we ignore W1,W2 apply W3 and then apply the MD which makes us get:

      Base->mut3->mut2 which is not correct.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dralves David Alves
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: