[MXS-3778] MaxScale crashes when using Cache filter Created: 2021-09-21  Updated: 2022-11-19  Resolved: 2022-11-19

Status: Closed
Project: MariaDB MaxScale
Component/s: cache
Affects Version/s: 6.1.1
Fix Version/s: 6.2.0

Type: Bug Priority: Major
Reporter: Philip Hoyer Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

Debian 10, MaxScale 6.1.1, MariaDB 10.3.29


Sprint: MXS-SPRINT-142, MXS-SPRINT-143

 Description   

When using the Cache filter it seems that MaxScale crashes on certain events, especially when changes in the database are made (INSERT, UPDATE, DELETE). For example our web application responds with a 500 error, when adding a forum post.

Might be related to MXS-3694, but regardless of the settings of the cache MaxScale crashes and restarts.

2021-09-21 12:38:19   error  : (4) [cache] (Read-Write-Service); Item in LRU list was not found in key mapping.
2021-09-21 12:38:19   error  : (4) [cache] (Read-Write-Service); Item in LRU list was not found in key mapping.
alert  : MaxScale 6.1.1 received fatal signal 11. Commit ID: 9b4abbc9bd86e6f9b6c3fc581214eb8583d959e4 System name: Linux Release string: undefined
 
 
2021-09-21 12:38:19   alert  : (4) (Read-Write-Service); MaxScale 6.1.1 received fatal signal 11. Commit ID: 9b4abbc9bd86e6f9b6c3fc581214eb8583d959e4 System name: Linux Release string: undefined
2021-09-21 12:38:19   alert  : (4) (Read-Write-Service); Statement currently being classified: none/unknown
2021-09-21 12:38:19   alert  : (4) (Read-Write-Service); DCB: 0x7f4a9001d590 Session: 4 Service: Read-Write-Service
alert  :   /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZNK10LRUStorage11remove_nodeEPNS_4NodeE+0x1f) [0x7f4a9c0e1e3f]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZNK10LRUStorage9free_nodeEPNS_4NodeE+0x15) [0x7f4a9c0e1ea5]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage10invalidateEPNS_4NodeENS_7ContextE+0x36) [0x7f4a9c0e30e6]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage14LRUInvalidator10invalidateERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x261) [0x7f4a9c0e4831]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage13do_invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE+0x36) [0x7f4a9c0e2506]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN12LRUStorageMT10invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EERKSt8functionIFvjEE+0x47) [0x7f4a9c0e5627]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN18CacheFilterSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x77b) [0x7f4a9c0db22b]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libreadwritesplit.so(_ZN14RWSplitSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x2d5) [0x7f4a9c0847e5]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN15ServiceEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x97) [0x7f4aa1f4a667]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN14ServerEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0xab) [0x7f4aa1f4061b]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN24MariaDBBackendConnection11normal_readEv+0x1f6) [0x7f4aa1f765f6]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB14process_eventsEj+0xc4) [0x7f4aa1ed5d64]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB13event_handlerEPS_j+0x21) [0x7f4aa1ed5e61]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker15poll_waiteventsEv+0x1e3) [0x7f4aa1fb6243]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker3runEPNS_9SemaphoreE+0x4f) [0x7f4aa1fb644f]: <binutils not installed>
  /lib/x86_64-linux-gnu/libstdc++.so.6(+0xbbb2f) [0x7f4aa166cb2f]: <binutils not installed>
  /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f4aa1207fa3]: <binutils not installed>
  /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f4aa0f8c4cf]: <binutils not installed>
 
 
2021-09-21 12:38:19   alert  : (4) (Read-Write-Service);
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZNK10LRUStorage11remove_nodeEPNS_4NodeE+0x1f) [0x7f4a9c0e1e3f]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZNK10LRUStorage9free_nodeEPNS_4NodeE+0x15) [0x7f4a9c0e1ea5]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage10invalidateEPNS_4NodeENS_7ContextE+0x36) [0x7f4a9c0e30e6]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage14LRUInvalidator10invalidateERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x261) [0x7f4a9c0e4831]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage13do_invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE+0x36) [0x7f4a9c0e2506]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN12LRUStorageMT10invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EERKSt8functionIFvjEE+0x47) [0x7f4a9c0e5627]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN18CacheFilterSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x77b) [0x7f4a9c0db22b]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libreadwritesplit.so(_ZN14RWSplitSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x2d5) [0x7f4a9c0847e5]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN15ServiceEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x97) [0x7f4aa1f4a667]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN14ServerEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0xab) [0x7f4aa1f4061b]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN24MariaDBBackendConnection11normal_readEv+0x1f6) [0x7f4aa1f765f6]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB14process_eventsEj+0xc4) [0x7f4aa1ed5d64]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB13event_handlerEPS_j+0x21) [0x7f4aa1ed5e61]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker15poll_waiteventsEv+0x1e3) [0x7f4aa1fb6243]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker3runEPNS_9SemaphoreE+0x4f) [0x7f4aa1fb644f]: <binutils not installed>
  /lib/x86_64-linux-gnu/libstdc++.so.6(+0xbbb2f) [0x7f4aa166cb2f]: <binutils not installed>
  /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f4aa1207fa3]: <binutils not installed>
  /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f4aa0f8c4cf]: <binutils not installed>
alert  : Writing core dump.



 Comments   
Comment by markus makela [ 2021-09-21 ]

It's possible that this is indeed MXS-3694 but we'll know only once 6.1.2 is released as it'll contain the fix: 6.1.1 did not yet include it.

Comment by markus makela [ 2021-09-23 ]

Philip Hoyer have you tested if this happens with 2.5.15?

Comment by Philip Hoyer [ 2021-09-24 ]

Yes, it happened with 2.5.15 first, then we updated MaxScale to 6.1.1 and the result were the same. I have noticed in the query log, that the crash usually happens (but not always!) when a DELETE statement is execute, which should invalidate the cache.

In the following example with version 2.5.15 the first DELETE statement for table usr_data_multi successfully invalidates the cache, but the second DELETE statement for table usr_pref fails:

2021-09-20 19:30:40   notice : (8) [cache] (Read-Write-Service) IGNORE, "DELETE FROM usr_data_multi WHERE usr_...", statement is not SELECT.
2021-09-20 19:30:40   info   : (8) (Read-Write-Service) > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 53, type: QUERY_TYPE_WRITE, stmt: DELETE FROM usr_data_multi WHERE usr_id = 149421
2021-09-20 19:30:40   info   : (8) [readwritesplit] (Read-Write-Service) Route query to master: db-test02 <
2021-09-20 19:30:40   info   : (8) [readwritesplit] (Read-Write-Service) Reply complete, last reply from db-test02
2021-09-20 19:30:40   notice : (8) [cache] (Read-Write-Service) Cache successfully invalidated.
2021-09-20 19:30:40   notice : (8) [cache] (Read-Write-Service) IGNORE, "DELETE FROM usr_pref WHERE usr_id = 1...", statement is not SELECT.
2021-09-20 19:30:40   info   : (8) (Read-Write-Service) > Autocommit: [enabled], trx is [not open], cmd: (0x03) COM_QUERY, plen: 47, type: QUERY_TYPE_WRITE, stmt: DELETE FROM usr_pref WHERE usr_id = 149421
2021-09-20 19:30:40   info   : (8) [readwritesplit] (Read-Write-Service) Route query to master: db-test02 <
2021-09-20 19:30:40   info   : (8) [readwritesplit] (Read-Write-Service) Reply complete, last reply from db-test02
2021-09-20 19:30:40   error  : (8) [cache] (Read-Write-Service) Item in LRU list was not found in key mapping.
alert  : MaxScale 2.5.15 received fatal signal 11. Commit ID: 2ddd29138544e9ff3071bd9d2d253dc82291b0f9 System name: Linux Release string: undefined
 
 
2021-09-20 19:30:40   alert  : (8) (Read-Write-Service) MaxScale 2.5.15 received fatal signal 11. Commit ID: 2ddd29138544e9ff3071bd9d2d253dc82291b0f9 System name: Linux Release string: undefined
2021-09-20 19:30:40   alert  : (8) (Read-Write-Service) Statement currently being classified: none/unknown
alert  :   /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZNK10LRUStorage11remove_nodeEPNS_4NodeE+0x1f) [0x7f28c3fdc13f]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZNK10LRUStorage9free_nodeEPNS_4NodeENS_17InvalidatorActionE+0x30) [0x7f28c3fdc1c0]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage10invalidateEPNS_4NodeENS_7ContextE+0x38) [0x7f28c3fdd428]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage14LRUInvalidator10invalidateERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x261) [0x7f28c3fdeb81]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage13do_invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE+0x36) [0x7f28c3fdc816]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN12LRUStorageMT10invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EERKSt8functionIFvjEE+0x47) [0x7f28c3fdf977]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN18CacheFilterSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x75d) [0x7f28c3fd5ddd]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN8maxscale6FilterI11CacheFilter18CacheFilterSessionE14apiClientReplyEP10mxs_filterP18mxs_filter_sessionP5GWBUFRKSt6vectorIPNS_8EndpointESaISC_EERKNS_5ReplyE+0x1a) [0x7f28c3fcefaa]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libreadwritesplit.so(_ZN14RWSplitSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x1c2) [0x7f28c3f7d752]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libreadwritesplit.so(_ZN8maxscale6RouterI7RWSplit14RWSplitSessionE11clientReplyEP10mxs_routerP18mxs_router_sessionP5GWBUFRKSt6vectorIPNS_8EndpointESaISC_EERKNS_5ReplyE+0x25) [0x7f28c3f72c45]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN15ServiceEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x9b) [0x7f28d6e4196b]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN14ServerEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0xa8) [0x7f28d6e373f8]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmariadbclient.so(_ZN24MariaDBBackendConnection11normal_readEv+0x280) [0x7f28d0094640]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB14process_eventsEj+0xcc) [0x7f28d6de284c]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB13event_handlerEPS_j+0x21) [0x7f28d6de2961]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker15poll_waiteventsEv+0x1be) [0x7f28d6e6b03e]: <binutils not installed>
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker3runEPNS_9SemaphoreE+0x53) [0x7f28d6e6b253]: <binutils not installed>
  /lib/x86_64-linux-gnu/libstdc++.so.6(+0xbbb2f) [0x7f28d63b1b2f]: <binutils not installed>
  /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3) [0x7f28d69ccfa3]: <binutils not installed>
  /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f28d5ed34cf]: <binutils not installed>

Comment by Johan Wikman [ 2021-09-28 ]

Philip Hoyer 6.1.2 that contains a fix for MXS-3694, has now been released. Could you please check whether that resolves your problem as well.

Comment by Philip Hoyer [ 2021-09-29 ]

Yes, with 6.1.2 it is still crashing unfortunately. But I have noticed a new "debug assert" in the log:

2021-09-29 13:31:43   error  : (292) [cache] (Read-Write-Service); debug assert at /home/timofey_turenko_mariadb_com/MaxScale/server/modules/filter/cache/lrustorage.cc:749 failed: pKey
debug assert at /home/timofey_turenko_mariadb_com/MaxScale/server/modules/filter/cache/lrustorage.cc:749 failed: pKey
alert  : MaxScale 6.1.2 received fatal signal 6. Commit ID: 1479685b53546a0758137c81b864539a80b13bbc System name: Linux Release string: undefined
 
 
2021-09-29 13:31:43   alert  : (292) (Read-Write-Service); MaxScale 6.1.2 received fatal signal 6. Commit ID: 1479685b53546a0758137c81b864539a80b13bbc System name: Linux Release string: undefined
2021-09-29 13:31:43   alert  : (292) (Read-Write-Service); Statement currently being classified: none/unknown
2021-09-29 13:31:43   alert  : (292) (Read-Write-Service); DCB: 0x7fc18c01de90 Session: 292 Service: Read-Write-Service
nm: /lib/x86_64-linux-gnu/libc.so.6: no symbols
alert  :   /lib/x86_64-linux-gnu/libpthread.so.0(raise+0x10b): /build/glibc-vjB4T1/glibc-2.28/nptl/../sysdeps/unix/sysv/linux/raise.c:51 (discriminator 3)
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage14free_node_dataEPNS_4NodeENS_7ContextE+0xf2): server/modules/filter/cache/lrustorage.cc:751
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage10invalidateEPNS_4NodeENS_7ContextE+0xcf): server/modules/filter/cache/lrustorage.cc:1022
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage15FullInvalidator15invalidate_nodeEPNS_4NodeE+0x2c): server/modules/filter/cache/lrustorage.cc:275
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage14LRUInvalidator10invalidateERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x1a4): server/modules/filter/cache/lrustorage.cc:205
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN10LRUStorage13do_invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE+0x11b): server/modules/filter/cache/lrustorage.cc:538
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN12LRUStorageMT10invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EERKSt8functionIFvjEE+0x4a): server/modules/filter/cache/lrustoragemt.$
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN11CacheSimple10invalidateEPN7Storage5TokenERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EERKSt8functionIFvjEE+0x46): server/modules/filter/cache/cachesimple.cc$
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN12SessionCache10invalidateERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EERKSt8functionIFvjEE+0x51): server/modules/filter/cache/sessioncache.hh:118
  /usr/lib/x86_64-linux-gnu/maxscale/libcache.so(_ZN18CacheFilterSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x281): server/modules/filter/cache/cachefiltersession.cc:552 (discriminator 4)
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN8maxscale13RouterSession11clientReplyEP5GWBUFRKSt6vectorIPNS_8EndpointESaIS5_EERKNS_5ReplyE+0x40): server/core/router.cc:31
  /usr/lib/x86_64-linux-gnu/maxscale/libreadwritesplit.so(_ZN14RWSplitSession11clientReplyEP5GWBUFRKSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0xd4b): server/modules/routing/readwritesplit/rwsplitsession.cc:646
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN15ServiceEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x11f): server/core/service.cc:1667
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN14ServerEndpoint11clientReplyEP5GWBUFRSt6vectorIPN8maxscale8EndpointESaIS5_EERKNS3_5ReplyE+0x13b): server/core/server.cc:955 (discriminator 2)
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN24MariaDBBackendConnection11normal_readEv+0x785): server/modules/protocol/MariaDB/mariadb_backend.cc:647
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN24MariaDBBackendConnection17ready_for_readingEP3DCB+0x35f): server/modules/protocol/MariaDB/mariadb_backend.cc:441
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB14process_eventsEj+0x54d): server/core/dcb.cc:1259
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB13event_handlerEPS_j+0x2f): server/core/dcb.cc:1311
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN3DCB12poll_handlerEP13MXB_POLL_DATAP10MXB_WORKERj+0x54): server/core/dcb.cc:1350
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker15poll_waiteventsEv+0x4a6): maxutils/maxbase/src/worker.cc:863
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker3runEPNS_9SemaphoreE+0x12c): maxutils/maxbase/src/worker.cc:560
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZN7maxbase6Worker11thread_mainEPS0_PNS_9SemaphoreE+0x23): maxutils/maxbase/src/worker.cc:685
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZSt13__invoke_implIvPFvPN7maxbase6WorkerEPNS0_9SemaphoreEEJS2_S4_EET_St14__invoke_otherOT0_DpOT1_+0x4c): /usr/include/c++/8/bits/invoke.h:60
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZSt8__invokeIPFvPN7maxbase6WorkerEPNS0_9SemaphoreEEJS2_S4_EENSt15__invoke_resultIT_JDpT0_EE4typeEOS8_DpOS9_+0x4f): /usr/include/c++/8/bits/invoke.h:96
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZNSt6thread8_InvokerISt5tupleIJPFvPN7maxbase6WorkerEPNS2_9SemaphoreEES4_S6_EEE9_M_invokeIJLm0ELm1ELm2EEEEDTcl8__invokespcl10_S_declvalIXT_EEEEESt12_Index_tupleIJXspT_EEE+$
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZNSt6thread8_InvokerISt5tupleIJPFvPN7maxbase6WorkerEPNS2_9SemaphoreEES4_S6_EEEclEv+0x18): /usr/include/c++/8/thread:253
  /usr/lib/x86_64-linux-gnu/maxscale/libmaxscale-common.so.1.0.0(_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN7maxbase6WorkerEPNS3_9SemaphoreEES5_S7_EEEEE6_M_runEv+0x1c): /usr/include/c++/8/thread:196
  /lib/x86_64-linux-gnu/libstdc++.so.6(+0xbbb2f): ??:?
  /lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3): /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:487 (discriminator 6)
  /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f): ??:0

Comment by Johan Wikman [ 2021-09-29 ]

Thanks.

The debug assert is caused by the 6.1.2 packages being by mistake debug and not release packages. That we are addressing at this very moment.

Comment by Johan Wikman [ 2021-10-25 ]

Philip Hoyer Could you paste your cache configuration? Remove any sensitive data.

Comment by Philip Hoyer [ 2021-10-25 ]

[cache]
type=filter
module=cache
cache_in_transactions=all_transactions
cached_data=shared
clear_cache_on_parse_errors=true
debug=0
enabled=true
hard_ttl=30s
invalidate=current
max_count=0
max_resultset_rows=0
max_resultset_size=0
max_size=1Gi
rules=
selects=verify_cacheable
soft_ttl=20s
storage=storage_inmemory
storage_options=
timeout=5s
users=mixed

Comment by Johan Wikman [ 2021-10-25 ]

Philip Hoyer No need for the config, I have found the bug.

Comment by Johan Wikman [ 2021-10-26 ]

Philip Hoyer Thanks for the config, although it turned out that I found the bug before I actually noticed that you had pasted it.

Apparently you have a statement, conceptually similar to

SELECT * FROM usr_data_multi UNION SELECT * from usr_pref

When the result is cached, a note is made that this result depends upon usr_data_multi and usr_pref. Internally, there is a mapping from each table (for which at least one result has been cached) to all results depending on that table.

When the statement DELETE FROM usr_data_multi ... is made, all results that depend upon usr_data_multi are evicted from the cache. However, the bug was that the note made for usr_pref was not removed, which caused freed memory to be accessed (with a subsequent crash) when the statement DELETE FROM usr_pref ... was made.

Anyway, the bug has now been fixed and will be in the next 6.1 release.

Comment by Johan Wikman [ 2021-10-26 ]

If a statement, such as

SELECT * FROM tbl1 UNION SELECT * from tbl2

that depends upon two tables, is cached, it will be invalidated if either of those tables is modified, e.g. DELETE FROM tbl2. However, there would then be a crash if there is a subsequent invalidating statement addressing the other table, e.g. DELETE FROM tbl1.

Comment by Brock Wilson (Inactive) [ 2022-11-18 ]

This appears to still happen in MaxScale 22.08.02

2022-11-18 18:18:30   alert  : (464) MaxScale 22.08.2 received fatal signal 11. Commit ID: d6662b78821027046876bedd0d2b687908fef091 System name: Linux Release string: Red Hat Enterprise Linux Server release 7.9 (Maipo)
2022-11-18 18:18:30   alert  : (464) Statement currently being classified: none/unknown
2022-11-18 18:18:30   notice : (464) Stmt 33(2022-11-18 18:18:29): set autocommit=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')

MaxScale config

 
[maxscalecache]
type=filter
module=cache
storage=storage_inmemory
#soft_ttl=30
#hard_ttl=45
cached_data=shared
#cached_data=thread_specific
max_size=100Mi
#selects=verify_cacheable
selects=assume_cacheable
 
 
[Galera-Service]
type=service
router=readwritesplit
enable_root_user=true
#router=readconnroute
servers=PP_MTR_MAIN_DB1,PP_MTR_MAIN_DB2,PP_MTR_MAIN_DB3
user=maxscale
password=XXXXXXXX
master_accept_reads=false
#master_reconnection=true  
#master_failure_mode=error_on_write
#transaction_replay_retry_on_deadlock=true 
#transaction_replay=true
#slave_selection_criteria=ADAPTIVE_ROUTING
filters=maxscalecache
#max_slave_connections=1
transaction_replay=true
#idle_session_pool_time=500ms
lazy_connect=false
connection_keepalive=0s
retain_last_statements=50
#max_connections = 9950 
auth_all_servers=true
#connection_timeout=1860s 
 
[Galera-Listener]
address=0.0.0.0
type=listener
service=Galera-Service
protocol=MariaDBClient
port=3307
ssl=false
ssl_cert=/opt/galera/cert/crt.maxscale.pem
ssl_key=/opt/galera/cert/key.csr.maxscale.pem
ssl_ca_cert=/opt/galera/cert/crt.ca.maxscale.pem

Comment by Brock Wilson (Inactive) [ 2022-11-18 ]

customer is reporting issue in 22.08.2, RHEL 7.9

Backend is MySQL 5.7. not sure if that matters, but making a note of it.

Comment by markus makela [ 2022-11-19 ]

bwilson please include the whole stacktrace. We can't know if it's the same issue unless we have the whole stacktrace or a way to reproduce it.

Comment by markus makela [ 2022-11-19 ]

bwilson please open a new bug report for this. If it's a regression, we'll close it as a duplicate but right now it seems to be a different bug.

Generated at Thu Feb 08 04:23:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.