{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/11209","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/11209/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/11209/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/11209/events","html_url":"https://github.com/cockroachdb/cockroach/issues/11209","id":191355370,"number":11209,"title":"Unexpected error during ALTER TABLE ... SPLIT AT","user":{"login":"jseldess","id":15893490,"avatar_url":"https://avatars.githubusercontent.com/u/15893490?v=3","gravatar_id":"","url":"https://api.github.com/users/jseldess","html_url":"https://github.com/jseldess","followers_url":"https://api.github.com/users/jseldess/followers","following_url":"https://api.github.com/users/jseldess/following{/other_user}","gists_url":"https://api.github.com/users/jseldess/gists{/gist_id}","starred_url":"https://api.github.com/users/jseldess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseldess/subscriptions","organizations_url":"https://api.github.com/users/jseldess/orgs","repos_url":"https://api.github.com/users/jseldess/repos","events_url":"https://api.github.com/users/jseldess/events{/privacy}","received_events_url":"https://api.github.com/users/jseldess/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T18:59:11Z","updated_at":"2016-11-23T19:00:32Z","closed_at":null,"body":"Note: This happened for me only one time, while running a 3-node local cluster. It does not happen on a single-node cluster. And I can't seem to reproduce this on a 3-node cluster. But want to report it just in case. cc: @knz \r\n\r\nStep 1. Start a 3-node local cluster:\r\n\r\n```\r\n$ cockroach start --background\r\n\r\n$ cockroach start --background \\\r\n--store=node2 \\\r\n--port=26258 \\\r\n--http-port=8081 \\\r\n--join=localhost:26257\r\n\r\n$ cockroach start --background \\\r\n--store=node3 \\\r\n--port=26259 \\\r\n--http-port=8082 \\\r\n--join=localhost:26257\r\n```\r\n\r\nStep 2. Drastically reduce the max range size:\r\n\r\n```\r\n$ cat default_update.yaml\r\nrange_min_bytes: 65535\r\nrange_max_bytes: 65536\r\n\r\n$ cockroach zone set .default -f default_update.yaml\r\n```\r\n\r\nStep 3. Write a bunch of rows and force a bunch of range splits via `ALTER TABLE .. SPLIT AT`: \r\n\r\n```\r\n$ (echo \"CREATE DATABASE splittest; CREATE TABLE splittest.foo(x INT PRIMARY KEY);\"; for ((i=0;i<1000;i++)); do echo \"INSERT INTO splittest.foo(x) VALUES ($i); ALTER TABLE splittest.foo SPLIT AT ($i);\"; done) | cockroach sql\r\n```\r\n\r\nResult: It works for a while and then returns these errors:\r\n\r\n```\r\npq: storage/replica_command.go:2455: split at key /Table/51/1/173 failed: span and descriptor's range do not overlap: {/Table/51/1/173 /System/StatusNode/2} vs range_id:245 start_key:\"\\273\\211\\366\\254\" end_key:\"\\377\\377\" replicas:<node_id:1 store_id:1 replica_id:1 > replicas:<node_id:2 store_id:2 replica_id:2 > replicas:<node_id:3 store_id:3 replica_id:3 > next_replica_id:4\r\nError: pq: storage/replica_command.go:2455: split at key /Table/51/1/173 failed: span and descriptor's range do not overlap: {/Table/51/1/173 /System/StatusNode/2} vs range_id:245 start_key:\"\\273\\211\\366\\254\" end_key:\"\\377\\377\" replicas:<node_id:1 store_id:1 replica_id:1 > replicas:<node_id:2 store_id:2 replica_id:2 > replicas:<node_id:3 store_id:3 replica_id:3 > next_replica_id:4\r\nFailed running \"sql\"\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/262602917","html_url":"https://github.com/cockroachdb/cockroach/issues/11209#issuecomment-262602917","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/11209","id":262602917,"user":{"login":"knz","id":642886,"avatar_url":"https://avatars.githubusercontent.com/u/642886?v=3","gravatar_id":"","url":"https://api.github.com/users/knz","html_url":"https://github.com/knz","followers_url":"https://api.github.com/users/knz/followers","following_url":"https://api.github.com/users/knz/following{/other_user}","gists_url":"https://api.github.com/users/knz/gists{/gist_id}","starred_url":"https://api.github.com/users/knz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knz/subscriptions","organizations_url":"https://api.github.com/users/knz/orgs","repos_url":"https://api.github.com/users/knz/repos","events_url":"https://api.github.com/users/knz/events{/privacy}","received_events_url":"https://api.github.com/users/knz/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T19:00:32Z","updated_at":"2016-11-23T19:00:32Z","body":"cc @spencerkimball "}}
{"actor":{"display_login":"knz"}}