Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-47

Session freeze when small tail packet

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.4
    • 1.1.0
    • mariadbbackend
    • None
    • Ubuntu precise 64bits

    Description

      In our environment, we experienced random freezes and by drilling down, we found one specific query whose resultset size was very close to the MTU and was sometimes sent in 2 chunks. After some tests, adding or removing bytes to columns title, it appears that when the second chunk (the tail), is less than 5 bytes, it freezes while if it is more, it is ok. Here's a debug log of a freeze:

      2015-03-17 14:54:09 139839053664384 [poll_waitevents] Read in dcb 0x1dfa420 fd 22
      2015-03-17 14:54:09 139839053664384 [gw_read_backend_event] Read dcb 0x1dfa420 fd 22 protocol state 7, MYSQL_IDLE.
      2015-03-17 14:54:09 139839053664384 [dcb_read] Read 1448 bytes from dcb 0x1dfa420 in state DCB_STATE_POLLING fd 22.
      2015-03-17 14:54:09 139839053664384 [protocol_get_srv_command] Read command UNKNOWN MYSQL PACKET TYPE for fd 22.
      2015-03-17 14:54:09 139839053664384 [dcb_write] Wrote 1448 Bytes to dcb 0x1dec390 in state DCB_STATE_POLLING fd 21
      2015-03-17 14:54:09 139839053664384 [poll_waitevents] epoll_wait found 1 fds
      2015-03-17 14:54:09 139839053664384 [poll_waitevents] event 5 dcb 0x1dfa420 role DCB_ROLE_REQUEST_HANDLER
      2015-03-17 14:54:09 139839053664384 [gw_write_backend_event] wrote to dcb 0x1dfa420 fd 22, return 1
      2015-03-17 14:54:09 139839053664384 [poll_waitevents] Read in dcb 0x1dfa420 fd 22
      2015-03-17 14:54:09 139839053664384 [gw_read_backend_event] Read dcb 0x1dfa420 fd 22 protocol state 7, MYSQL_IDLE.
      2015-03-17 14:54:09 139839053664384 [dcb_read] Read 4 bytes from dcb 0x1dfa420 in state DCB_STATE_POLLING fd 22.
      2015-03-17 14:54:12 139839053664384 [poll_waitevents] epoll_wait found 1 fds
      2015-03-17 14:54:12 139839053664384 [poll_waitevents] event 1 dcb 0x1de0690 role DCB_ROLE_SERVICE_LISTENER
      2015-03-17 14:54:12 139839053664384 [poll_waitevents] Accept in fd 12
      2015-03-17 14:54:12 139839053664384 [gw_MySQLAccept] Accepted fd 23.

      The "Read 4 bytes" is the small tail. When it doesn't freeze, it looks like:

      2015-03-17 14:54:08 139839053664384 [readconnroute:routeQuery] Routed command 3 to dcb 0x1dfa420 with return value 1.
      2015-03-17 14:54:08 139839053664384 [poll_waitevents] epoll_wait found 1 fds
      2015-03-17 14:54:08 139839053664384 [poll_waitevents] event 5 dcb 0x1dfa420 role DCB_ROLE_REQUEST_HANDLER
      2015-03-17 14:54:08 139839053664384 [gw_write_backend_event] wrote to dcb 0x1dfa420 fd 22, return 1
      2015-03-17 14:54:08 139839053664384 [poll_waitevents] Read in dcb 0x1dfa420 fd 22
      2015-03-17 14:54:08 139839053664384 [gw_read_backend_event] Read dcb 0x1dfa420 fd 22 protocol state 7, MYSQL_IDLE.
      2015-03-17 14:54:08 139839053664384 [dcb_read] Read 1452 bytes from dcb 0x1dfa420 in state DCB_STATE_POLLING fd 22.
      2015-03-17 14:54:08 139839053664384 [protocol_get_srv_command] Read command UNKNOWN MYSQL PACKET TYPE for fd 22.
      2015-03-17 14:54:08 139839053664384 [dcb_write] Wrote 1452 Bytes to dcb 0x1df9a00 in state DCB_STATE_POLLING fd 21
      2015-03-17 14:54:08 139839053664384 [poll_waitevents] epoll_wait found 1 fds
      2015-03-17 14:54:08 139839053664384 [poll_waitevents] event 8197 dcb 0x1df9a00 role DCB_ROLE_REQUEST_HANDLER
      2015-03-17 14:54:08 139839053664384 [poll_waitevents] Read in dcb 0x1df9a00 fd 21

      Looking at the code, I saw at few places conditions like:

      if (nbytes_read < 5)
      {

      I suspect something is wrong with one of these.

      --Yves

      Attachments

        Activity

          People

            markus makela markus makela
            ytrudeau Yves Trudeau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.