You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Na Li (JIRA)" <ji...@apache.org> on 2017/04/03 17:14:41 UTC
[jira] [Comment Edited] (SENTRY-1614) DB schema key is too long for
MySQL
[ https://issues.apache.org/jira/browse/SENTRY-1614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15953836#comment-15953836 ]
Na Li edited comment on SENTRY-1614 at 4/3/17 5:13 PM:
-------------------------------------------------------
The problem is fixed for me after I apply all of the following changes. I am on CentOS Linux 7
1. add ROW_FORMAT=DYNAMIC at end of CREATE TABLE `SENTRY_DB_PRIVILEGE`.
2. use prefix indixes "ALTER TABLE `SENTRY_DB_PRIVILEGE` ADD INDEX `SENTRY_PRIV_URI_IDX` (`URI`(1010));" instead of "ALTER TABLE `SENTRY_DB_PRIVILEGE` ADD INDEX `SENTRY_PRIV_URI_IDX` (`URI`);"
3. remove `PATHS` from primary key in table `MAUTHZPATHSMAPPING_PATHS`
CREATE TABLE `MAUTHZPATHSMAPPING_PATHS`
(
`AUTHZ_OBJ_ID_OID` BIGINT NOT NULL,
`PATHS` VARCHAR(4000) BINARY NOT NULL,
CONSTRAINT `MAUTHZPATHSMAPPING_PATHS_PK` PRIMARY KEY (`AUTHZ_OBJ_ID_OID`,`PATHS`)
) ENGINE=INNODB;
was (Author: linaataustin):
The problem is fixed for me after I apply all of the following changes
1. add ROW_FORMAT=DYNAMIC at end of CREATE TABLE `SENTRY_DB_PRIVILEGE`.
2. use prefix indixes "ALTER TABLE `SENTRY_DB_PRIVILEGE` ADD INDEX `SENTRY_PRIV_URI_IDX` (`URI`(1010));" instead of "ALTER TABLE `SENTRY_DB_PRIVILEGE` ADD INDEX `SENTRY_PRIV_URI_IDX` (`URI`);"
3. remove `PATHS` from primary key in table `MAUTHZPATHSMAPPING_PATHS`
CREATE TABLE `MAUTHZPATHSMAPPING_PATHS`
(
`AUTHZ_OBJ_ID_OID` BIGINT NOT NULL,
`PATHS` VARCHAR(4000) BINARY NOT NULL,
CONSTRAINT `MAUTHZPATHSMAPPING_PATHS_PK` PRIMARY KEY (`AUTHZ_OBJ_ID_OID`,`PATHS`)
) ENGINE=INNODB;
> DB schema key is too long for MySQL
> -----------------------------------
>
> Key: SENTRY-1614
> URL: https://issues.apache.org/jira/browse/SENTRY-1614
> Project: Sentry
> Issue Type: Bug
> Components: Sentry
> Affects Versions: sentry-ha-redesign
> Reporter: kalyan kumar kalvagadda
> Assignee: kalyan kumar kalvagadda
> Attachments: SENTRY-1614.001-sentry-ha-redesign.patch, SENTRY-1614.002-sentry-ha-redesign.patch
>
>
> When a schema tool is used to initialize sentry database schema we observing issue and the initialization of schema fails. Here are the details of the failure.
> *Error: Specified key was too long; max key length is 767 bytes*
> {noformat}
> Error: Specified key was too long; max key length is 767 bytes (state=42000,code=1071)
> Closing: 0: jdbc:mysql://192.168.56.103/sentry_db1
> org.apache.sentry.core.common.exception.SentryUserException: Schema initialization FAILED! Metastore state would be inconsistent !!
> *** Sentry schemaTool failed ***
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)