Title: key length errors (jobs table) · Issue #453 · datajoint/datajoint-python · GitHub
Open Graph Title: key length errors (jobs table) · Issue #453 · datajoint/datajoint-python
X Title: key length errors (jobs table) · Issue #453 · datajoint/datajoint-python
Description: While performing some DB maintenance testing, I encountered an error: pymysql.err.InternalError: (1071, 'Specified key was too long; max key length is 767 bytes') in Ubuntu 16.04/MariaDB 10.0 - Digging further, it appears that the jobs t...
Open Graph Description: While performing some DB maintenance testing, I encountered an error: pymysql.err.InternalError: (1071, 'Specified key was too long; max key length is 767 bytes') in Ubuntu 16.04/MariaDB 10.0 - Dig...
X Description: While performing some DB maintenance testing, I encountered an error: pymysql.err.InternalError: (1071, 'Specified key was too long; max key length is 767 bytes') in Ubuntu 16.04/MariaDB 10...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/453
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"key length errors (jobs table)","articleBody":"While performing some DB maintenance testing, I encountered an error:\r\n\r\n```\r\npymysql.err.InternalError: (1071, 'Specified key was too long; max key length is 767 bytes')\r\n```\r\n\r\nin Ubuntu 16.04/MariaDB 10.0 -\r\n\r\nDigging further, it appears that the jobs table key length \u0026 default database config for this setup result in a key longer than 767 bytes - default character set is ```utf8mb4``` which results in (255+32)*4 for the key.\r\n\r\nVarious posts/documentation pertaining to the InnoDB related parameters are below -\r\nOn this particular setup, enabling:\r\n\r\n```\r\ninnodb_file_format=Barracuda\r\ninnodb_large_prefix=on\r\n```\r\nto ```my.cnf``` and adding ```ROW_FORMAT=DYNAMIC``` to the query allowed the table to be created manually. Table creation (datajoint 0.10.0) with the single addition of the row format argument is as follows:\r\n\r\n```\r\nCREATE TABLE IF NOT EXISTS `pipline`.`~jobs` (\r\n`table_name` varchar(255) NOT NULL COMMENT \"className of the table\",\r\n`key_hash` char(32) NOT NULL COMMENT \"key hash\",\r\n`status` enum('reserved','error','ignore') NOT NULL COMMENT \"if tuple is missing, the job is available\",\r\n`key` blob DEFAULT NULL COMMENT \"structure containing the key\",\r\n`error_message` varchar(4096) NOT NULL DEFAULT \"\" COMMENT \"error message returned if failed\",\r\n`error_stack` blob DEFAULT NULL COMMENT \"error stack if failed\",\r\n`user` varchar(255) NOT NULL DEFAULT \"\" COMMENT \"database user\",\r\n`host` varchar(255) NOT NULL DEFAULT \"\" COMMENT \"system hostname\",\r\n`pid` int unsigned NOT NULL DEFAULT \"0\" COMMENT \"system process id\",\r\n`connection_id` bigint unsigned NOT NULL DEFAULT \"0\" COMMENT \"connection_id()\",\r\n`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"automatic timestamp\",\r\nPRIMARY KEY (`table_name`,`key_hash`)\r\n) ENGINE=InnoDB, ROW_FORMAT=DYNAMIC, COMMENT \"job reservation table for `pipline`\"\r\n```\r\n\r\nThis issue should not apparently occur on current MySQL and MariaDB InnoDB configurations since they default to ```DYNAMIC``` row configurations; That said adding the ```ROW_FORMAT=DYNAMIC``` tweak still might be useful in some situations. If nothing else, it can be noted here or perhaps documented more officially.\r\n\r\nVarious links:\r\n\r\nhttps://github.com/gogits/gogs/issues/4894 - details provided about similar issue\r\nhttps://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html - see issues concerning innodb restrictions\r\nhttps://dev.mysql.com/doc/refman/5.7/en/innodb-row-format-specification.html - misc on row formats\r\nhttps://mariadb.com/kb/en/library/xtradbinnodb-storage-formats/ - mariadb specific information\r\n\r\n","author":{"url":"https://github.com/ixcat","@type":"Person","name":"ixcat"},"datePublished":"2018-03-01T23:55:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/453/datajoint-python/issues/453"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c67a83d8-5c2a-a421-172d-c757ab683ac8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D09C:6F3CF:69312C8:932B636:6A504CDC |
| html-safe-nonce | b0887d383cd5ad58842499219ba2095352fdee48f1fa829e5a01bd335dbf41a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDlDOjZGM0NGOjY5MzEyQzg6OTMyQjYzNjo2QTUwNENEQyIsInZpc2l0b3JfaWQiOiI4NzQwNTA4MDY0MDUyOTU2MzgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 965288b341aba38fd958265c7b9010aeb02d2434899cb9529f3ed9594ddda818 |
| hovercard-subject-tag | issue:301604551 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/453/issue_layout |
| twitter:image | https://opengraph.githubassets.com/87dcc5af415820e2c792aa4817f3f374541a1d3b37caabfa31b02d66e5b50fb0/datajoint/datajoint-python/issues/453 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/87dcc5af415820e2c792aa4817f3f374541a1d3b37caabfa31b02d66e5b50fb0/datajoint/datajoint-python/issues/453 |
| og:image:alt | While performing some DB maintenance testing, I encountered an error: pymysql.err.InternalError: (1071, 'Specified key was too long; max key length is 767 bytes') in Ubuntu 16.04/MariaDB 10.0 - Dig... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ixcat |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5741a45fe07e5f377d0d4c524a92e3056acc51bb |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width