Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26543

Spider: [ERROR] Got error 12701 when reading table './test/t' on SELECT

Details

    Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t (c INT KEY,c2 INT,KEY(c2)) ENGINE=SPIDER PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
      ALTER TABLE t ADD c2 BINARY FIRST;
      SELECT * FROM t WHERE c2='' AND c2='' AND c='' ORDER BY c2 DESC;
      

      Leads to an ERROR visible in the error log only:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      2021-09-06 11:19:39 4 [ERROR] Got error 12701 when reading table './test/t'
      

      Furthermore, error 12701 is undefined:

      $ ./bin/perror 12701
      Illegal error code: 12701
      

      Bug confirmed present in:
      MariaDB: 10.4.22 (dbg), 10.4.22 (opt), 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (dbg), 10.3.32 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar added a comment - - edited

            nayuta-yanagisawa No direct idea on best way forward for this.

            Roel Roel Van de Paar added a comment - - edited nayuta-yanagisawa No direct idea on best way forward for this.

            I thought about the issue again and I now think that we should not print the error to the error log from the viewpoint of consistency.

            Spider raises ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM in some places but, as far as I know, they are not printed in the error log. Further, the error is not what should be necessarily notified to an administrator. That is because the error is mostly due to a wrong CREATE TABLE statement or the down of a data node. The first case is the user's fault, not the administrator's. The second case should be informed to the administrator by external health check or something.

            I also think that Spider should check whether CREATE TABLE is valid. This will be done once COMMENT style remote node specification is deprecated (then, one should use engine-defined attributes style).

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - - edited I thought about the issue again and I now think that we should not print the error to the error log from the viewpoint of consistency. Spider raises ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM in some places but, as far as I know, they are not printed in the error log. Further, the error is not what should be necessarily notified to an administrator. That is because the error is mostly due to a wrong CREATE TABLE statement or the down of a data node. The first case is the user's fault, not the administrator's. The second case should be informed to the administrator by external health check or something. I also think that Spider should check whether CREATE TABLE is valid. This will be done once COMMENT style remote node specification is deprecated (then, one should use engine-defined attributes style).

            Thinking some more about this too, here are some random questions which may help further the discussion:
            1) In many bug situations it seems we had the situation where the remote server is not available causing some crash. Once the crash is resolved, the message (on connect attempt, for example due to a SELECT) usually becomes

            ERROR 1429 (HY000): Unable to connect to foreign data source: localhost
            

            Would that not be the correct message to show here also?
            2) If so, would it be hard to change the code towards error 1429?
            3) A wrong table definition should be notified to the user imho (CLI/client level), though indeed not to the error log.
            4) The _NUM in the ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM name seems confusing to me. Can it be increased and decreased?

            Roel Roel Van de Paar added a comment - Thinking some more about this too, here are some random questions which may help further the discussion: 1) In many bug situations it seems we had the situation where the remote server is not available causing some crash. Once the crash is resolved, the message (on connect attempt, for example due to a SELECT) usually becomes ERROR 1429 (HY000): Unable to connect to foreign data source: localhost Would that not be the correct message to show here also? 2) If so, would it be hard to change the code towards error 1429? 3) A wrong table definition should be notified to the user imho (CLI/client level), though indeed not to the error log. 4) The _NUM in the ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM name seems confusing to me. Can it be increased and decreased?

            1), 2) I think the error message ERROR 1429 ... is appropriate here. In fact, the very message is shown on CLI (at least on 10.7 HEAD).
            3) I totally agree.
            4) NUM in ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM just mean the number/code of the error ER_SPIDER_REMOTE_SERVER_GONE_AWAY.

            #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM 12701
            #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_STR "Remote MySQL server has gone away"
            

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - 1), 2) I think the error message ERROR 1429 ... is appropriate here. In fact, the very message is shown on CLI (at least on 10.7 HEAD). 3) I totally agree. 4) NUM in ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM just mean the number/code of the error ER_SPIDER_REMOTE_SERVER_GONE_AWAY . #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM 12701 #define ER_SPIDER_REMOTE_SERVER_GONE_AWAY_STR "Remote MySQL server has gone away"

            Got it. All clear & agreed. Thanks

            Roel Roel Van de Paar added a comment - Got it. All clear & agreed. Thanks

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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