catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
70 stars 132 forks source link

Huge strings in auth_saml2_kvstore killing binlogs #808

Open thepurpleblob opened 2 months ago

thepurpleblob commented 2 months ago

We're seeing lots of instances of SAML2 writing huge strings into the above table. This is really giving our MySQL binlogs a hard time.

For example,

mysql> SELECT id,CHAR_LENGTH(value) AS LengthOfValue FROM mdl_auth_saml2_kvstore WHERE type ='session' AND expire LIKE '%17128%' ORDER BY LengthOfValue DESC LIMIT 50; +----------+---------------+ | id | LengthOfValue | +----------+---------------+ | 86592929 | 11746895 | | 86667038 | 2940322 | | 86693668 | 491520 | | 86690961 | 452214 | | 86671596 | 370979 | | 86657364 | 365110 | | 86667991 | 332414 | | 86682949 | 309809 | | 86661475 | 302619 | | 86693929 | 266779 | | 86542932 | 208408 | | 86656869 | 142746 | | 86639173 | 136263 | | 86693906 | 122913 | | 86672287 | 113278 | | 86678033 | 93596 | | 86661860 | 89038 | | 86666163 | 81738 | | 86667252 | 74356 | | 86692985 | 65551 | | 86653795 | 62838 | | 86668024 | 53938 | | 86700326 | 52604 | | 86699423 | 44089 | | 86676443 | 43073 | | 86697650 | 42877 | | 86698672 | 42843 | | 86658119 | 41643 | | 86697902 | 41274 | | 86684273 | 37895 | | 86694783 | 37530 | | 86671134 | 35639 | | 86692707 | 33447 | | 86698889 | 33435 | | 86685503 | 33213 | | 86698780 | 33030 | | 86676098 | 32862 | | 86689231 | 32438 | | 86697899 | 31828 | | 86653773 | 31770 | | 86676007 | 31592 | | 86692234 | 31261 | | 86672538 | 30002 | | 86700580 | 29471 | | 86666900 | 29337 | | 86693485 | 29227 | | 86678194 | 28523 | | 86700589 | 26585 | | 86691036 | 25049 | | 86687700 | 24703 | +----------+---------------+ 50 rows in set (0.55 sec)

I'm not sure if this is expected / unexpected and what to do next. Any help appreciated?

ph25sl commented 2 months ago

The timing of your post is so coincidental as I've just spent time investigating the same too.

ph25sl commented 2 months ago

Possibly a duplicate of this closed issue or at least related to https://github.com/catalyst/moodle-auth_saml2/issues/458