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

Load testing immudb hits max active snapshots error #1998

Closed
sleepycat opened this issue Jun 30, 2024 · 0 comments · Fixed by #2009
Closed

Load testing immudb hits max active snapshots error #1998

sleepycat opened this issue Jun 30, 2024 · 0 comments · Fixed by #2009
Labels
bug Something isn't working

Comments

@sleepycat
Copy link

What happened
When load testing immudb, a 1 second test will succeed, but a 5 second test will eventually will eventually return ERRO[0001] GoError: pq: tbtree: max active snapshots limit reached and after this error immudb cannot be used until it is restarted.

What you expected to happen
I expected the tests to complete regardless of the duration.

How to reproduce it (as minimally and precisely as possible)
Install the xk6 binary for building custom versions of k6.
go install go.k6.io/xk6/cmd/xk6@latest
Build a version of k6 with sql support in the current directory.
xk6 build v0.52.0 --with github.com/grafana/xk6-sql
Add the demo data to a fresh copy of immudb configured with maxActiveSnapshots = 1200:
image

Using the k6 binary built above, run ./k6 run sqltest.js --duration 1s with the following script:

import sql from 'k6/x/sql';

export function setup() {}

export function teardown() {}

export default function () {
  // The second argument is a PostgreSQL connection string, e.g.
  // postgres://myuser:mypass@127.0.0.1:5432/postgres?sslmode=disable
  const db = sql.open('postgres', 'postgres://immudb:immudb@localhost:5432/defaultdb?sslmode=disable');
  let results = sql.query(db, `SELECT * FROM orders JOIN customers ON orders.customerid = customers.id WHERE orders.productid = $1;`, 1);
  console.log({results})
  for (const row of results) {
    console.log(`key: ${row.key}, value: ${row.value}`);
  }
  db.close();
}

Running ./k6 run sqltest.js --duration 1s will succeed.
Running ./k6 run sqltest.js --duration 5s will fail with tbtree: max active snapshots limit reached
All subsequent tests of any duration will will fail with tbtree: max active snapshots limit reached
Restart immudb.
Running ./k6 run sqltest.js --duration 1s will succeed.

Environment

# run "immu* version" and copy/paste the output here
[mike@kijimi immudb-deployment]$ immudb version
immudb 1.9DOM.2
Commit  : d422d9f828c6ccfce6ce4af6c565946f764a15ca
Built by: makepkg
[mike@kijimi immudb-deployment]$ immuclient version
immuclient 1.9DOM.2
Commit  : d422d9f828c6ccfce6ce4af6c565946f764a15ca
Built by: makepkg
[mike@kijimi immudb-deployment]$ immuadmin version
immuadmin 1.9DOM.2
Commit  : d422d9f828c6ccfce6ce4af6c565946f764a15ca
Built by: makepkg

Additional info (any other context about the problem)

@sleepycat sleepycat added the bug Something isn't working label Jun 30, 2024
@ostafen ostafen linked a pull request Aug 7, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant