-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cockroach zone ls sometimes returns error #24154
Comments
I'm not sure yet whether it's related, but @vivekmenezes what's with all these errors in the logs?
|
Soooo it appears as though we don't delete the corresponding zone configs when we drop a table. This appears to apply to zone configs on tables as well as zone configs on a table's partitions. Not deleting the zone configs isn't the end of the world. It might even be important if, for example, the data in the table needs to be in a certain region for regulatory reasons. In such cases it could be disastrous if the system thought it was ok to move the data around after the table is dropped but before it's GC'ed/compacted. However:
Any thoughts on this, @benesch? |
We're definitely supposed to be dropping zone configs for tables/partitions when the table/partition they belong to is removed. Perhaps there's a bug while the table is marked as dropped but the descriptor is not yet removed? |
Maybe, but if so they sure stick around for a long time. I've created half a dozen zone configs for various tables and partitions that I've since deleted, and they're all still there, even about half an hour after deleting the first one. root@:26257/> EXPERIMENTAL SHOW ZONE CONFIGURATIONS;
+----+---------------+--------------------------------+--------------------------------------------------------------------------+
| id | cli_specifier | config_yaml | config_proto |
+----+---------------+--------------------------------+--------------------------------------------------------------------------+
| 0 | .default | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 \"\x04\b\x90\xbf\x05(\x03 |
| | | | |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: [] | |
| | | | |
| | | | |
| 15 | system.jobs | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 \"\x03\b\xd8\x04(\x03 |
| | | | |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 600 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: [] | |
| | | | |
| | | | |
| 16 | .meta | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 \"\x03\b\x90\x1c(\x03 |
| | | | |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 3600 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: [] | |
| | | | |
| | | | |
| 22 | .liveness | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 \"\x03\b\xd8\x04(\x03 |
| | | | |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 600 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: [] | |
| | | | |
| | | | |
| 53 | NULL | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 |
| | | | \"\x04\b\x90\xbf\x05(\x032\x142\x10\b\x01\x12\x06region\x1a\x04west8\x02 |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: {+region=west: 2} | |
| | | | |
| | | | |
| 53 | NULL | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 |
| | | | \"\x04\b\x90\xbf\x05(\x032\x142\x10\b\x01\x12\x06region\x1a\x04east8\x02 |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: {+region=east: 2} | |
| | | | |
| | | | |
| 54 | NULL | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 |
| | | | \"\x04\b\x90\xbf\x05(\x032\x142\x10\b\x01\x12\x06region\x1a\x04west8\x02 |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: {+region=west: 2} | |
| | | | |
| | | | |
| 54 | NULL | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 |
| | | | \"\x04\b\x90\xbf\x05(\x032\x142\x10\b\x01\x12\x06region\x1a\x04east8\x02 |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: {+region=east: 2} | |
| | | | |
| | | | |
| 55 | NULL | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 |
| | | | \"\x04\b\x90\xbf\x05(\x032\x142\x10\b\x01\x12\x06region\x1a\x04alex8\x02 |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: {+region=alex: 2} | |
| | | | |
| | | | |
| 58 | NULL | range_min_bytes: 1048576 | \x10\x80\x80@\x18\x80\x80\x80 |
| | | | \"\x04\b\x90\xbf\x05(\x032\x142\x10\b\x01\x12\x06region\x1a\x04alex8\x03 |
| | | range_max_bytes: 67108864 | |
| | | | |
| | | gc: | |
| | | | |
| | | ttlseconds: 90000 | |
| | | | |
| | | num_replicas: 3 | |
| | | | |
| | | constraints: {+region=alex: 3} | |
| | | | |
| | | | |
+----+---------------+--------------------------------+--------------------------------------------------------------------------+ |
cockroach/pkg/sql/schema_changer.go Lines 274 to 277 in 586afb0
|
Per the above, your GC TTL is set to the default 25h, so that's not unexpected. |
Ok, so we really just need to hide / ignore the NULL It's pretty inconsistent that we drop a database's zone config immediately, though. If a table's replication is being controlled by the database-level zone config, when you run |
Yep, think so.
Yikes, definitely. If I seem curt, it's only because I'm semi-AFK! Thanks for looking into this, Alex. |
This continues displaying them in the output of `SHOW EXPERIMENTAL ZONE CONFIGURATIONS`, but it still makes some sense there given that the zone configs are still in use, they just aren't addressable. Fixes cockroachdb#24154 Release note (bug fix): Fix a crash in `cockroach zone ls` that would happen if a table with a zone config on it had been deleted but not yet garbage collected. (this was broken in v2.0 alphas, not in v1.1)
This continues displaying them in the output of `SHOW EXPERIMENTAL ZONE CONFIGURATIONS`, but it still makes some sense there given that the zone configs are still in use, they just aren't addressable. Fixes cockroachdb#24154 Release note (bug fix): Fix a crash in `cockroach zone ls` that would happen if a table with a zone config on it had been deleted but not yet garbage collected. (this was broken in v2.0 alphas, not in v1.1)
BUG REPORT
log file for each node in your cluster. On most unix-based systems
running with defaults, this boils down to the output of
cockroach version
Build Tag: v2.0-beta.20180319
Build Time: 2018/03/19 18:54:14
Distribution: CCL
Platform: darwin amd64
Go Version: go1.10
C Compiler: 4.2.1 Compatible Clang 3.8.0 (tags/RELEASE_380/final)
Build SHA-1: e0b123c
Build Type: release
start from a brand new database
below sequence works
cockroach.mb-71.rslee.2018-03-22T17_54_38Z.045302.log.gz
The text was updated successfully, but these errors were encountered: