spqr icon indicating copy to clipboard operation
spqr copied to clipboard

index out of range on CREATE KEY RANGE

Open Denchick opened this issue 8 months ago • 0 comments

panic: runtime error: index out of range [8] with length 8 on CREATE KEY RANGE krid2 FROM 4611686018427387904 ROUTE TO sh2 FOR DISTRIBUTION ds1;

Logs:

➜  spqr git:(TestEncodeUInt64) ✗ docker logs 4adb3c8a87ce
2025/04/29 11:49:08 Running config: {
  "log_level": "debug",
  "pretty_logging": false,
  "time_quantiles": [
    0.75
  ],
  "daemonize": false,
  "maintain_params": false,
  "with_jaeger": false,
  "pgproto_debug": false,
  "pid_filename": "",
  "log_filename": "",
  "availability_zone": "",
  "prefer_same_availability_zone": false,
  "enable_role_system": true,
  "roles_file": "/spqr/test/regress/conf/roles.yaml",
  "host": "regress_router",
  "router_port": "6432",
  "router_ro_port": "",
  "admin_console_port": "7432",
  "grpc_api_port": "7000",
  "world_shard_fallback": true,
  "show_notice_messages": true,
  "init_sql": "",
  "use_init_sql": false,
  "exit_on_init_sql": false,
  "use_coordinator_init": false,
  "default_target_session_attrs": "",
  "memqdb_backup_path": "",
  "router_mode": "PROXY",
  "jaeger_url": "",
  "frontend_rules": [
    {
      "db": "regress",
      "usr": "regress",
      "auth_rule": {
        "auth_method": "ok",
        "password": "",
        "ldap_config": null,
        "gss_config": null
      },
      "search_path": "",
      "pool_mode": "TRANSACTION",
      "pool_discard": false,
      "pool_rollback": false,
      "pool_prepared_statement": false,
      "pool_default": false
    },
    {
      "db": "",
      "usr": "",
      "auth_rule": {
        "auth_method": "ok",
        "password": "",
        "ldap_config": null,
        "gss_config": null
      },
      "search_path": "",
      "pool_mode": "TRANSACTION",
      "pool_discard": false,
      "pool_rollback": false,
      "pool_prepared_statement": false,
      "pool_default": true
    }
  ],
  "query_routing": {
    "default_route_behaviour": "",
    "enhanced_multishard_processing": false
  },
  "frontend_tls": {
    "sslmode": "require",
    "key_file": "/etc/spqr/ssl/server.key",
    "cert_file": "/etc/spqr/ssl/server.crt",
    "root_cert_file": ""
  },
  "backend_rules": [
    {
      "db": "regress",
      "usr": "regress",
      "auth_rules": {
        "sh1": {
          "password": "12345678",
          "usr": ""
        },
        "sh2": {
          "password": "12345678",
          "usr": ""
        },
        "sh3": {
          "password": "12345678",
          "usr": ""
        },
        "sh4": {
          "password": "12345678",
          "usr": ""
        }
      },
      "auth_rule": null,
      "pool_default": false,
      "connection_limit": 0,
      "connection_retries": 0,
      "connection_timeout": 0,
      "keep_alive": 0,
      "tcp_user_timeout": 0
    }
  ],
  "shards": {
    "sh1": {
      "hosts": [
        "spqr_shard_1:6432"
      ],
      "type": "DATA",
      "tls": null
    },
    "sh2": {
      "hosts": [
        "spqr_shard_2:6432"
      ],
      "type": "DATA",
      "tls": null
    },
    "sh3": {
      "hosts": [
        "spqr_shard_3:6432"
      ],
      "type": "DATA",
      "tls": null
    },
    "sh4": {
      "hosts": [
        "spqr_shard_4:6432"
      ],
      "type": "DATA",
      "tls": null
    }
  },
  "schema_cache_backend_rule": {
    "db": "regress",
    "usr": "regress",
    "auth_rules": null,
    "auth_rule": null,
    "pool_default": false,
    "connection_limit": 0,
    "connection_retries": 0,
    "connection_timeout": 0,
    "keep_alive": 0,
    "tcp_user_timeout": 0
  },
  "multidb_pool_size": 0,
  "workload_file": "",
  "workload_batch_size": 0,
  "reuse_port": false,
  "with_coordinator": false,
  "ignore_cancel": false,
  "acceptor_buffer_size": 0,
  "disable_obsolete_client": false,
  "distributed_commit_strategy": "",
  "client_init_max": 0,
  "use_systemd_notifier": false,
  "systemd_notifier_debug": false
}
2025/04/29 11:49:08 Running roles config: {
  "table_groups": [
    {
      "id": "example_table_group",
      "readers": [
        "regress"
      ],
      "writers": [
        "regress"
      ],
      "admins": [
        "regress",
        "spqr-console"
      ]
    }
  ]
}
panic: runtime error: index out of range [8] with length 8

goroutine 584 [running]:
encoding/binary.PutUvarint({0x40003f74e0, 0x8, 0x8}, 0x80)
        /usr/local/go/src/encoding/binary/varint.go:54 +0xc8
encoding/binary.PutVarint({0x40003f74e0, 0x8, 0x8}, 0x4000000000000000)
        /usr/local/go/src/encoding/binary/varint.go:106 +0x60
github.com/pg-sharding/spqr/yacc/console.(*yyParserImpl).Parse(0x40004b0a88, {0x17ffe98, 0x40000d4280})
        gram.y:825 +0x92b4
github.com/pg-sharding/spqr/yacc/console.yyParse({0x17ffe98, 0x40000d4280})
        yaccpar:153 +0x54
github.com/pg-sharding/spqr/yacc/console.Parse({0x400028e420, 0x52})
        /spqr/yacc/console/util.go:39 +0x50
github.com/pg-sharding/spqr/router/console.(*LocalInstanceConsole).ProcessQuery(0x4000197270, {0x1807940, 0x21167e0}, {0x400028e420, 0x52}, {0x1824610, 0x40003a0000}, {0x17f6520, 0x21167e0})
        /spqr/router/console/console.go:64 +0x64
github.com/pg-sharding/spqr/router/console.(*LocalInstanceConsole).Serve(0x4000197270, {0x1807940, 0x21167e0}, {0x1824610, 0x40003a0000})
        /spqr/router/console/console.go:162 +0xc40
github.com/pg-sharding/spqr/router/instance.(*InstanceImpl).serv(0x40001afe80, {0x180c018, 0x400006ab98}, 0x0)
        /spqr/router/instance/instance.go:179 +0x5a0
github.com/pg-sharding/spqr/router/instance.(*InstanceImpl).Run.func4()
        /spqr/router/instance/instance.go:251 +0x54
created by github.com/pg-sharding/spqr/router/instance.(*InstanceImpl).Run in goroutine 7
        /spqr/router/instance/instance.go:250 +0x740

Denchick avatar Apr 29 '25 11:04 Denchick