Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
tank
Commits
242512ba
Commit
242512ba
authored
5 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
Improve explanation of MariaDB (Ubuntu 18.04 is also affected)
fixes
#1
parent
63f93003
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+4
-4
4 additions, 4 deletions
README.md
contrib/mariadb-stretch-err1071.md
+18
-12
18 additions, 12 deletions
contrib/mariadb-stretch-err1071.md
with
22 additions
and
16 deletions
README.md
+
4
−
4
View file @
242512ba
...
...
@@ -22,16 +22,16 @@ And then run the `tank` binary:
$ $GOPATH
/bin/tank
--config
config.yaml run
--listen
localhost:8040
```
### Problem with
MariaDB on Debian 9 (stretch)
### Problem with
some versions of MariaDB
If you start
`tank`
for the first time you may get the following error message:
If you start
`tank`
for the first time
using MariaDB
you may get the following error message:
```
running database migrations failed: Error 1071: Specified key was too long; max key length is 767 bytes
```
This most likely means you are using a
MariaDB s
erver
running on Debian 9 (stretch). Please read
[
contrib/mariadb-stretch-err1071.md
](
/contrib/mariadb-stretch-err1071.md
)
for help.
This most likely means you are using a
n old
er
ver
sion of MariaDB with the default character-set set to
`utf8mb4`
. Please read
[
contrib/mariadb-stretch-err1071.md
](
/contrib/mariadb-stretch-err1071.md
)
for help.
If you encouter this problem on any other platform please let us know!
...
...
This diff is collapsed.
Click to expand it.
contrib/mariadb-stretch-err1071.md
+
18
−
12
View file @
242512ba
...
...
@@ -2,14 +2,15 @@
## Background
`tank`
stores shows using it's name as primary key. Since this is a string it
by default is mapped to a
`VARCHAR(255)`
inside the database.
Starting with Debian 9 (stretch) MariaDB is installed instead of mySQL. Debian also
switched to
`utf8mb4`
as the default character set in an attempt to support Emoji's
stored as UTF-8 characters in the database.
This means that a
`VARCHAR(255)`
is now 1021 bytes long which exceeds the maximum
length (767 bytes) for primary key indices when
`innodb`
is used (also the default since quite
some time).
`tank`
stores shows using it's name as primary key. Since this is a string it by default is
mapped to a
`VARCHAR(255)`
at the database level.
Some Linux distributions, i.e. Debian 9 (stretch) or Ubuntu 18.04 (bionic) have switched to
the mySQL fork MariaDB. At least Debian und Ubuntu also switched to
`utf8mb4`
as
the default character-set. This is an attempt to support Emoji's stored as UTF-8 characters in
the database for applications like Wordpress.
When using
`utf8mb4`
a
`VARCHAR(255)`
field can be up to 1021 bytes long. This exceeds the
maximum length (767 bytes) for primary key indices on older version of the
`innodb`
file and row
formats.
## Possible Workarounds
...
...
@@ -26,7 +27,7 @@ create database tank CHARACTER SET utf8 COLLATE utf8_general_ci;
*
Debian has
[
backported
](
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=886756
)
some
changes to the MariaDB version in Debian Stretch. Because of this it is possible to switch
to the new innodb
layout which is the default for newer version of MariaDB as well as mySQL
.
to the new innodb
file and row format
.
You can do this by adding the following to the
`[mysqld]`
section of
`/etc/mysql/mariadb.conf.d/50-server.cnf`
:
```
ini
...
...
@@ -35,14 +36,19 @@ innodb_file_per_table = On
innodb_large_prefix
=
On
innodb_default_row_format
=
dynamic
```
As far as i can see Ubuntu did not add this patch to it's packages but starting with 10.2
MariaDB uses the new format by default. This means you can work around the issue by using
the packages provided by the
[
MariaDB Foundation
](
https://downloads.mariadb.org/mariadb/repositories/
)
.
*
Consider switching to another DBMS:
*
`tank`
also works with postgres
*
you may use the mySQL Community Packages from
[
Oracle
](
https://dev.mysql.com/doc/refman/5.7/en/linux-installation-debian.html
)
*
[
Percona Server
](
https://www.percona.com/software/mysql-database/percona-server
)
is drop-in replacement for mySQL
*
[
Percona Server
](
https://www.percona.com/software/mysql-database/percona-server
)
is a drop-in
replacement for mySQL
*
If for some reason none of the above is applicable as a last resort you can apply the patch below.
This limits the length for show names to 191 characters which is just short enough to not exceed the limit.
*
If for some reason none of the above is applicable, as a last resort, you can apply the
patch below. This limits the length for show names to 191 characters which is just short
enough to not exceed the limit.
```
patch
diff --git a/store/types.go b/store/types.go
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment