Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2.7
    • N/A
    • None
    • FreeBSD 10.3-STABLE, MariaDB running inside of a dedicated jail with no other changes/packages

    Description

      The FreeBSD specific patch for rsync Galera SST doesn't work.

      https://github.com/MariaDB/server/commit/cf1b0c1ace3584fcd807e0643d30956baa5de2c2#diff-ce1fe90d058fac6e05405aced56e6f83

      local port_info=$(netstat -46lp $\{rsync_port\} 2>/dev/null | \
      grep ":$\{rsync_port\}")
      

      netstat -p on FreeBSD is for protocol, not port number or program/PID. This command always results in the following error message being sent to /dev/null

      netstat: 4444: unknown or uninstrumented protocol

      From man:

           -f	address_family,	-p protocol
      	   Limit display to those records of the specified address_family or a
      	   single protocol.  The following address families and	protocols are
      	   recognized:
       
      	   Family		       Protocols
      	   inet	(AF_INET)	       divert, icmp, igmp, ip, ipsec, pim,
      				       sctp, tcp, udp
      	   inet6 (AF_INET6)	       icmp6, ip6, ipsec6, rip6, tcp, udp
      	   pfkey (PF_KEY)	       pfkey
      	   netgraph, ng	(AF_NETGRAPH)  ctrl, data
      	   unix	(AF_UNIX)
      	   link	(AF_LINK)
       
      	   The program will complain if	protocol is unknown or if there	is no
      	   statistics routine for it.
      

      Additionally, specifying both -4 and -6 at the same time doesn't work. The latter will overwrite the former. If it is specified as netstat -46, only IPv6 is used. If it is specified as netstat -64, only IPv4 is used.

      One other note: there is no mention in the FreeBSD man page of netstat being able to return PID at all, which is the whole point of this call to begin with. Searching around online, everyone is suggesting using lsof to get this information, which is exactly what was happening BEFORE this broken OS specific patch was applied.

      Attachments

        Issue Links

          Activity

            spil Bernard Spil added a comment -

            There's an error in the script I supplied. It should be ` sockstat`, not `netstat`

            https://www.freebsd.org/cgi/man.cgi?query=sockstat
            ```
            -4 Show AF_INET (IPv4) sockets.
            -6 Show AF_INET6 (IPv6) sockets.
            -p ports Only show Internet sockets if the local or foreign port num-
            ber is on the specified list. The ports argument is a comma-
            separated list of port numbers and ranges specified as first
            and last port separated by a dash.
            ```

            spil Bernard Spil added a comment - There's an error in the script I supplied. It should be ` sockstat`, not `netstat` https://www.freebsd.org/cgi/man.cgi?query=sockstat ``` -4 Show AF_INET (IPv4) sockets. -6 Show AF_INET6 (IPv6) sockets. -p ports Only show Internet sockets if the local or foreign port num- ber is on the specified list. The ports argument is a comma- separated list of port numbers and ranges specified as first and last port separated by a dash. ```

            The issue was addressed in last comment at https://github.com/MariaDB/server/pull/205 , but somehow the fix escaped final patch.
            So `netstat` must be just replaced with `sockstat` call in provided line.

            anikitin Andrii Nikitin (Inactive) added a comment - The issue was addressed in last comment at https://github.com/MariaDB/server/pull/205 , but somehow the fix escaped final patch. So `netstat` must be just replaced with `sockstat` call in provided line.
            anikitin Andrii Nikitin (Inactive) added a comment - Actually I do see sockstat in https://github.com/MariaDB/server/blame/10.2/scripts/wsrep_sst_rsync.sh#L68 https://github.com/MariaDB/server/blame/10.3/scripts/wsrep_sst_rsync.sh#L68 So you may need this commit as well https://github.com/MariaDB/server/commit/44ccb8f29ea82d913ec1b55b61c8bbc7c64738a5 So I will close this as 'cannot reproduce'

            People

              anikitin Andrii Nikitin (Inactive)
              darkain Vincent Milum Jr
              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.