Skip to content

Add revision to reads in TXN to robustness test and add regression test #18683

Open
@serathius

Description

@serathius

What would you like to be added?

Issue #18667 was not detected by robustness test because TXN we generate don't set revision in range. We should fix this gap.

TODO:

  • Add randomly adding revision to generating multiTXNOps
    func (c etcdTrafficClient) pickMultiTxnOps() (ops []clientv3.Op) {
    keys := rand.Perm(c.keyCount)
    opTypes := make([]model.OperationType, 4)
    atLeastOnePut := false
    for i := 0; i < MultiOpTxnOpCount; i++ {
    opTypes[i] = c.pickOperationType()
    if opTypes[i] == model.PutOperation {
    atLeastOnePut = true
    }
    }
    // Ensure at least one put to make operation unique
    if !atLeastOnePut {
    opTypes[0] = model.PutOperation
    }
    for i, opType := range opTypes {
    key := c.key(keys[i])
    switch opType {
    case model.RangeOperation:
    ops = append(ops, clientv3.OpGet(key))
    case model.PutOperation:
    value := fmt.Sprintf("%d", c.idProvider.NewRequestID())
    ops = append(ops, clientv3.OpPut(key, value))
    case model.DeleteOperation:
    ops = append(ops, clientv3.OpDelete(key))
    default:
    panic("unsuported choice type")
    }
    }
    return ops
    }
  • Add regression test make test-robustness-issue18667 like in https://github.com/etcd-io/etcd/pull/17680/files

Note, until fix for #18667 is merged, we cannot enable running this test by default. Might need to make setting revision optional and only run it as regression test, only later enabling it by default.

As discussed on Slack @henrybear327 volunteered to work on it.

Why is this needed?

Cover detect and prevent #18667

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions