[ 
https://issues.apache.org/jira/browse/HIVE-5606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13801665#comment-13801665
 ] 

Brett Randall commented on HIVE-5606:
-------------------------------------

Thanks Prasad your comments.

I notice now that in {{hive-default.xml.template}} for 0.12, 
{{hive.metastore.schema.verification}} equals {{true}} (this is the config I 
copied, and how I arrived at this problem), whereas for trunk it has been added 
as default {{false}}.  The {{<description>}} however is incorrect for trunk, is 
still claims:

{quote}
True: Verify that version information stored in metastore matches with one from 
Hive jars.  Also disable automatic
schema migration attempt. Users are required to manully migrate schema after 
Hive upgrade which ensures
proper metastore schema migration. (Default)
{quote}

... that True is Default.

Is that intentional?  For 0.12 installations (only) that happen to deploy the 
default config, the metastore schema version will be checked, but for 0.13 and 
onwards if you deploy the default config, you need to explicitly enable the 
check?

I don't see how when creating a first-time/default/Derby metastore database, it 
can be considered incompatible with the current runtime version which is 
creating it.  We can't corrupt a metastore which doesn't exits.  So it feels 
like a bug to me, but I agree that the severity is less now that the property 
is default {{false}} on trunk.  That said, I do wonder how many folks will 
benefit from the new version-check enhancement, if they copy the default config 
- next time they upgrade the check likely won't be active.

> Default Derby metastore_db initial creation fails if 
> hive.metastore.schema.verification=true
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-5606
>                 URL: https://issues.apache.org/jira/browse/HIVE-5606
>             Project: Hive
>          Issue Type: Bug
>          Components: Database/Schema
>    Affects Versions: 0.12.0
>         Environment: JDK 1.6.0_43, Hadoop 1.2.1
>            Reporter: Brett Randall
>
> Hive cannot create the default//initial/Derby metastore_db, if new 0.12 
> configuration property {{hive.metastore.schema.verification}} is set to 
> {{true}}.
> # Start with a clean 0.12 installation, or remove any existing (Derby) 
> default metastore_db directory
> # In {{hive-site.xml}}, set {{hive.metastore.schema.verification=true}}
> # Start hive CLI
> # Run {{hive> create database if not exists mydb;}}
> The following exception occurs:
> {noformat}
> 2013-10-22 15:02:59,390 WARN  bonecp.BoneCPConfig 
> (BoneCPConfig.java:sanitize(1537)) - Max Connections < 1. Setting to 20
> 2013-10-22 15:03:01,899 ERROR exec.DDLTask (DDLTask.java:execute(435)) - 
> org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: 
> Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
>         at 
> org.apache.hadoop.hive.ql.metadata.Hive.createDatabase(Hive.java:231)
>         at 
> org.apache.hadoop.hive.ql.exec.DDLTask.createDatabase(DDLTask.java:3442)
>         at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:227)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151)
>         at 
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1414)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1192)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1020)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:888)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:781)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
> Caused by: java.lang.RuntimeException: Unable to instantiate 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient
>         at 
> org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1212)
>         at 
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:62)
>         at 
> org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:72)
>         at 
> org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2372)
>         at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2383)
>         at 
> org.apache.hadoop.hive.ql.metadata.Hive.createDatabase(Hive.java:225)
>         ... 19 more
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at 
> org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1210)
>         ... 24 more
> Caused by: MetaException(message:Version information not found in metastore. )
>         at 
> org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:5638)
>         at 
> org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:5622)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.hadoop.hive.metastore.RetryingRawStore.invoke(RetryingRawStore.java:124)
>         at com.sun.proxy.$Proxy10.verifySchema(Unknown Source)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:403)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:441)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:326)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:286)
>         at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:54)
>         at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:59)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore.newHMSHandler(HiveMetaStore.java:4060)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:121)
>         ... 29 more
> 2013-10-22 15:03:01,900 ERROR ql.Driver (SessionState.java:printError(419)) - 
> FAILED: Execution Error, return code 1 from 
> org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException: Unable to 
> instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
> {noformat}
> The version check should not apply when creating the initial Derby 
> metastore_db.
> *Workaround*: set hive.metastore.schema.verification=false, run Hive CLI and 
> perform any operation that forces the metastore to be created.  On 0.12 this 
> will add the 0.12.0 version to the VERSION table.  You can then change 
> hive.metastore.schema.verification=true if you prefer for subsequent access.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to