Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
serathius opened this issue Oct 5, 2024 · 2 comments
Open

Comments

@serathius
Copy link
Member

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

@serathius
Copy link
Member Author

Any progress?

@serathius
Copy link
Member Author

ping @henrybear327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants