Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logictest: statement_statistics failure with local-spec-planning #52763

Closed
Tracked by #52617
asubiotto opened this issue Aug 13, 2020 · 2 comments · Fixed by #98117
Closed
Tracked by #52617

logictest: statement_statistics failure with local-spec-planning #52763

asubiotto opened this issue Aug 13, 2020 · 2 comments · Fixed by #98117
Assignees
Labels
A-multitenancy Related to multi-tenancy A-sql-execution Relating to SQL execution. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team

Comments

@asubiotto
Copy link
Contributor

asubiotto commented Aug 13, 2020

Running statement_statistics with a config other than local should work. It seems that in some configs, SELECT x FROM test WHERE y IN (_, _, __more3__) is dropped. This is the case with the local-spec-planning and 3node-tenant.

    TestLogic/local-spec-planning/statement_statistics: logic.go:2063:

        testdata/logic_test/statement_statistics:109: SELECT key,flags
          FROM test.crdb_internal.node_statement_statistics
         WHERE application_name = 'valuetest' ORDER BY key, flags
        expected:
            key                                                               flags
            INSERT INTO test VALUES (_, _, __more1__), (__more1__)            ·
            SELECT (_, _, __more3__) FROM test WHERE _                        ·
            SELECT key FROM test.crdb_internal.node_statement_statistics      ·
            SELECT sin(_)                                                     ·
            SELECT sqrt(_)                                                    !
            SELECT x FROM (VALUES (_, _, __more1__), (__more1__)) AS t (x)    ·
            SELECT x FROM test WHERE y = (_ / z)                              !+
            SELECT x FROM test WHERE y IN (_, _, _ + x, _, _)                 ·
            SELECT x FROM test WHERE y IN (_, _, __more3__)                   ·
            SELECT x FROM test WHERE y IN (_, _, __more3__)                   +
            SELECT x FROM test WHERE y NOT IN (_, _, __more3__)               ·
            SET CLUSTER SETTING "debug.panic_on_failed_assertions" = DEFAULT  ·
            SET CLUSTER SETTING "debug.panic_on_failed_assertions" = _        ·
            SET application_name = _                                          ·
            SET distsql = "on"                                                ·
            SHOW CLUSTER SETTING "debug.panic_on_failed_assertions"           ·
            SHOW application_name                                             ·

        but found (query options: "colnames") :
            key                                                               flags
            INSERT INTO test VALUES (_, _, __more1__), (__more1__)            ·
            SELECT (_, _, __more3__) FROM test WHERE _                        ·
            SELECT key FROM test.crdb_internal.node_statement_statistics      ·
            SELECT sin(_)                                                     ·
            SELECT sqrt(_)                                                    !
            SELECT x FROM (VALUES (_, _, __more1__), (__more1__)) AS t (x)    ·
            SELECT x FROM test WHERE y = (_ / z)                              !
            SELECT x FROM test WHERE y IN (_, _, _ + x, _, _)                 ·
            SELECT x FROM test WHERE y IN (_, _, __more3__)                   ·
            SELECT x FROM test WHERE y NOT IN (_, _, __more3__)               ·
            SET CLUSTER SETTING "debug.panic_on_failed_assertions" = DEFAULT  ·
            SET CLUSTER SETTING "debug.panic_on_failed_assertions" = _        ·
            SET application_name = _                                          ·
            SET distsql = "on"                                                ·
            SHOW CLUSTER SETTING "debug.panic_on_failed_assertions"           ·
            SHOW application_name                                             ·

--- done: testdata/logic_test/statement_statistics with config local-spec-planning: 26 tests, 1 failures

    TestLogic/local-spec-planning/statement_statistics: logic.go:2644:
        testdata/logic_test/statement_statistics:133: error while processing
    TestLogic/local-spec-planning/statement_statistics: logic.go:2644: testdata/logic_test/statement_statistics:133: too many errors encountered, skipping the rest of the input

Jira issue: CRDB-7997

@asubiotto asubiotto added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-execution Relating to SQL execution. labels Aug 13, 2020
@jlinder jlinder added the T-sql-queries SQL Queries Team label Jun 16, 2021
@stevendanna
Copy link
Collaborator

This test still fails in 3node-tenant but now it appears only because of the flags. The + flag is for DistSQL which isn't available in tenant mode.

        --- FAIL: TestTenantLogic/3node-tenant/statement_statistics (0.76s)
            logic.go:2400: 
                 
                ../../sql/logictest/testdata/logic_test/statement_statistics:113: SELECT key,flags
                  FROM test.crdb_internal.node_statement_statistics
                 WHERE application_name = 'valuetest' ORDER BY key, flags
                expected:
                    key                                                               flags
                    INSERT INTO test VALUES (_, _, __more1__), (__more1__)            ·
                    SELECT (_, _, __more3__) FROM test WHERE _                        ·
                    SELECT key FROM test.crdb_internal.node_statement_statistics      ·
                    SELECT sin(_)                                                     ·
                    SELECT sqrt(_)                                                    !
                    SELECT x FROM (VALUES (_, _, __more1__), (__more1__)) AS t (x)    ·
                    SELECT x FROM test WHERE y = (_ / z)                              !+
                    SELECT x FROM test WHERE y IN (_, _, _ + x, _, _)                 ·
                    SELECT x FROM test WHERE y IN (_, _, __more3__)                   +
                    SELECT x FROM test WHERE y NOT IN (_, _, __more3__)               ·
                    SET CLUSTER SETTING "debug.panic_on_failed_assertions" = DEFAULT  ·
                    SET CLUSTER SETTING "debug.panic_on_failed_assertions" = _        ·
                    SET application_name = '_'                                          ·
                    SET distsql = "on"                                                ·
                    SHOW CLUSTER SETTING "debug.panic_on_failed_assertions"           ·
                    SHOW application_name                                             ·
                    
                but found (query options: "colnames") :
                    key                                                               flags
                    INSERT INTO test VALUES (_, _, __more1__), (__more1__)            ·
                    SELECT (_, _, __more3__) FROM test WHERE _                        ·
                    SELECT key FROM test.crdb_internal.node_statement_statistics      ·
                    SELECT sin(_)                                                     ·
                    SELECT sqrt(_)                                                    !
                    SELECT x FROM (VALUES (_, _, __more1__), (__more1__)) AS t (x)    ·
                    SELECT x FROM test WHERE y = (_ / z)                              !
                    SELECT x FROM test WHERE y IN (_, _, _ + x, _, _)                 ·
                    SELECT x FROM test WHERE y IN (_, _, __more3__)                   ·
                    SELECT x FROM test WHERE y NOT IN (_, _, __more3__)               ·
                    SET CLUSTER SETTING "debug.panic_on_failed_assertions" = DEFAULT  ·
                    SET CLUSTER SETTING "debug.panic_on_failed_assertions" = _        ·
                    SET application_name = '_'                                        ·
                    SET distsql = "on"                                                ·
                    SHOW CLUSTER SETTING "debug.panic_on_failed_assertions"           ·
                    SHOW application_name                                             ·
            logic.go:3282: 
                ../../sql/logictest/testdata/logic_test/statement_statistics:136: error while processing

@knz knz added the A-multitenancy Related to multi-tenancy label Jun 14, 2022
@stevendanna stevendanna self-assigned this Jun 14, 2022
@rytaft
Copy link
Collaborator

rytaft commented Jan 19, 2023

Note from Slack: Seeing as how it’s a failure in statement_statistics and we think that it’s solved with the DistSQL work that Rachael and Yahor completed last year, could I ask that someone on the queries team try it out to see if the test can now be unskipped in 3node-tenant mode? No urgency, but it would be nice if we got it re-enabled this release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-multitenancy Related to multi-tenancy A-sql-execution Relating to SQL execution. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants