Skip to content

Conversation

@VarunNagaraju
Copy link
Contributor

@VarunNagaraju VarunNagaraju commented Jul 10, 2025

https://perconadev.atlassian.net/browse/PSTRESS-152

Introduced support for Foreign key tables in Pstress.

  • The tables with foreign key references are suffixed with _fk while
    creating the tables.
  • These FK tables include ifk_col column referencing parent table's
    ipkey.
  • Example : When --fk-prob is 50 --tables 100 options are passed, there
    is a 50% chance there will be a table tt_N_fk whose parent would be
    tt_N.
  • To fully test FK behaviour, use --fk-prob=100 --pk-prob=100
  • The FK tables can be disabled with --no-fk option.

Fixed transaction behaviour:

  • Ensured START TRANSACTION doesn't block other sessions by running
    transactions independently.

Adjusted the default probabilities of some features:

  • A new option called partition-prob is added which controls the number
    of partition tables created and is set to 10% by default.
  • The exisiting option ratio-normal-temp is replaced with a new option,
    temporary-prob to control the number of temporary tables and is set to
    10% by default.
  • The exisiting option commit-rollback-ratio is replaced with a new option,
    commit-prob, which controls the probability of executing commit and is
    set to 95 by default.
  • Decreased the probability of using SAVEPOINT in a transaction from 50%
    to 10%.
  • The option primary-key-probability is renamed to --pk-prob fpr clarity.

Thanks Rahul Malik for the contribution.
(github.com/#92)

https://perconadev.atlassian.net/browse/PSTRESS-152

Introduced support for Foreign key tables in Pstress.
* The tables with foreign key references are suffixed with `_fk` while
  creating the tables.
* These FK tables include `ifk_col` column referencing parent table's
  `ipkey`.
* Example : When --fk-prob is 50 --tables 100 options are passed, there
  is a 50% chance there will be a table tt_N_fk whose parent would be
  tt_N.
* To fully test FK behaviour, use `--fk-prob=100 --pk-prob=100`
* The FK tables can be disabled with `--no-fk` option.

Fixed transaction behaviour:
* Ensured `START TRANSACTION` doesn't block other sessions by running
  transactions independently.

Adjusted the default probabilities of some features:
* A new option called partition-prob is added which controls the number
  of partition tables created and is set to 10% by default.
* The exisiting option ratio-normal-temp is replaced with a new option,
  temporary-prob to control the number of temporary tables and is set to
  10% by default.
* The exisiting option commit-rollback-ratio is replaced with a new option,
  commit-prob, which controls the probability of executing commit and is
  set to 95 by default.
* Decreased the probability of using SAVEPOINT in a transaction from 50%
  to 10%.
* The option `primary-key-probability` is renamed to `--pk-prob` fpr clarity.

Thanks Rahul Malik for the contribution.
(github.com/Percona-QA/pull/92)
Copy link
Contributor

@inikep inikep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert in pstress but didn't found anything suspicious

enabled

https://perconadev.atlassian.net/browse/PSTRESS-152

Problem
=======
The parent table pointer of the foreign key table object became invalid
after the first trial and was not updated properly for the subsequent
trials causing SIGSEGV errors.

Solution
========
The parent table name is also stored in the dll file for each step and
the parent table pointer for tables with foreign keys is set properly
when metadata is loaded from the dll files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants