-
Notifications
You must be signed in to change notification settings - Fork 21
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 support for Foregin keys table in Pstress #92
base: master
Are you sure you want to change the base?
Conversation
Added new table type in pstress with suffix _fk table. Number of tables depends on fk-prob. Such table will have column ifk_col reference to a parent table ipkey for example if --fk-prob is 50 and --tables 100. there is 50% chance there will be a table tt_N_fk whose parent would be tt_N Since they linked to pk of parent table. To test FK use --fk-prob=100 --pk-prob=100 To disable foreign keys use --no-fk Also rename some existing options like primary-key-probability is now pk-prob ratio-normal-temp is not temp-prob Fixed the code around START TRANSACTION. Previously it was running as single transaction which would block transaction on other session. Decrease the probability of using SAVE POINT in a transaction to 10 % from 25% default Decrease the probablity of partition tables to 10%; Decrease the probablity of temporary tables to 10%;
60e3375
to
6305c08
Compare
Hi @rahulmalik87 - Thanks for the pull request. We are looking into it. |
src/common.hpp
Outdated
@@ -120,7 +117,7 @@ struct Option { | |||
MYSQLD_SERVER_OPTION = 'z', | |||
TRANSATION_PRB_K, | |||
TRANSACTIONS_SIZE, | |||
COMMMIT_TO_ROLLBACK_RATIO, | |||
COMMMIT_PROB, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the name to "COMMIT_PROB"
@rahulmalik87 - Few observations
Tested the patch, but don't see which table the foreign key column is referencing to. Normally a foreign key syntax looks like this
|
Thank you for testing. |
@rahulmalik87 - Use |
@rahulmalik87 Some more problems found: `Test Case1: ./pstress-ps --tables 50 --records 100 --no-temp-tables --no-partition-tables --fk-prob 100 --socket /tmp/mysql_22000.sock --threads 5 --logdir Thread 2 failed, check logs for detail message Error: Test Case 2: ./pstress-ps --tables 10 --records 100 --only-partition-tables --fk-prob 100 --socket /tmp/mysql_22000.sock --threads 5 --logdir This creates only one table instead of creating 10 partition tables with FK references Test Case 3: ./pstress-ps --tables 10 --records 100 --fk-prob 100 --pk-prob 100 --seconds 10 --threads 5 --socket /tmp/mysql_22000.sock --logdir This does not create FK reference tables` |
I have fixed the Test case 1. |
Fk table tries to insert entries from previous table and gets an error Failed to add constraint during alter Now if parent table has 0 records, then fk table will also be empty
c1cf914
to
b2d7b76
Compare
@rahulmalik87 Thanks for the contribution, can u please look into the other failures? |
Thank you @rahulmalik87 for reviving/addressing review comments! |
Added new table type in pstress with suffix _fk table.
Number of tables depends on fk-prob.
Such table will have column ifk_col reference to a parent table ipkey
for example if --fk-prob is 50 and --tables 100.
there is 50% chance there will be a table tt_N_fk whose parent would be tt_N
Since they linked to pk of parent table. To test FK use --fk-prob=100 --pk-prob=100
To disable foreign keys use --no-fk
Also rename some existing options like
primary-key-probability is now pk-prob
ratio-normal-temp is now temp-prob
Fixed the code around START TRANSACTION. Previously it was running as single transaction which would block transaction on other session.
Decrease the probability of using SAVE POINT in a transaction to 10 % from 25% default