github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/storage/testdata/mvcc_histories/merges (about)

     1  # The MVCC merge operator is non-transactional and stores data in the
     2  # intent, so that subsequent reads diregard the MVCC values stored on
     3  # the same key.
     4  #
     5  # This is a very unique feature and is currently only used in CockroachDB's
     6  # built-in timeseries database.
     7  
     8  run ok
     9  with t=A
    10    txn_begin  ts=11
    11    put        k=a v=abc resolve
    12    txn_remove
    13  ----
    14  >> at end:
    15  data: "a"/0.000000011,0 -> /BYTES/abc
    16  
    17  # Merge appends data in the intent and ignores the regular k/v pairs.
    18  
    19  run trace ok
    20  merge k=a v=def ts=22
    21  merge k=a v=ghi ts=22
    22  ----
    23  >> merge k=a v=def ts=22
    24  meta: "a"/0,0 -> txn={<nil>} ts=0,0 del=false klen=0 vlen=0 raw=/BYTES/def
    25  data: "a"/0.000000011,0 -> /BYTES/abc
    26  >> merge k=a v=ghi ts=22
    27  meta: "a"/0,0 -> txn={<nil>} ts=0,0 del=false klen=0 vlen=0 raw=/BYTES/defghi
    28  data: "a"/0.000000011,0 -> /BYTES/abc
    29  
    30  # After a merge, only the data in the intent is every used.
    31  
    32  run ok
    33  with t=A
    34    txn_begin ts=33
    35    get k=a
    36  ----
    37  get: "a" -> /BYTES/defghi @0,0
    38  >> at end:
    39  txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=0.000000033,0 min=0,0 seq=0} lock=true stat=PENDING rts=0.000000033,0 wto=false max=0,0