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

genDeleteRows is mostly running on non-existing keys #348

Open
dkropachev opened this issue Jun 11, 2023 · 0 comments
Open

genDeleteRows is mostly running on non-existing keys #348

dkropachev opened this issue Jun 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@dkropachev
Copy link
Collaborator

func GenMutateStmt(s *testschema.Schema, t *testschema.Table, g generators.GeneratorInterface, r *rand.Rand, p *typedef.PartitionRangeConfig, deletes bool) (*typedef.Stmt, error) {
t.RLock()
defer t.RUnlock()
valuesWithToken := g.Get()
if valuesWithToken == nil {
return nil, nil
}
useLWT := false
if p.UseLWT && r.Uint32()%10 == 0 {
useLWT = true
}
if !deletes {
return genInsertOrUpdateStmt(s, t, valuesWithToken, r, p, useLWT)
}
switch n := rand.Intn(1000); n {
case 10, 100:
return genDeleteRows(s, t, valuesWithToken, r, p)
default:
switch rand.Intn(2) {
case 0:
if t.KnownIssues[typedef.KnownIssuesJSONWithTuples] {
return genInsertOrUpdateStmt(s, t, valuesWithToken, r, p, useLWT)
}
return genInsertJSONStmt(s, t, valuesWithToken, r, p)
default:
return genInsertOrUpdateStmt(s, t, valuesWithToken, r, p, useLWT)
}
}
}

Row deletion should be running on both existing and non-existing records with different ration.
We need to split them into different statements type.

@dkropachev dkropachev added the bug Something isn't working label Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant