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

Hive QA commented on HIVE-16886:
--------------------------------



Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12884316/HIVE-16886.5.patch

{color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 80 failed/errored test(s), 11000 tests 
executed
*Failed tests:*
{noformat}
TestTxnCommandsBase - did not produce a TEST-*.xml file (likely timed out) 
(batchId=280)
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[insert_values_orig_table_use_metadata]
 (batchId=61)
org.apache.hadoop.hive.cli.TestMiniSparkOnYarnCliDriver.testCliDriver[spark_vectorized_dynamic_partition_pruning]
 (batchId=169)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query14] 
(batchId=234)
org.apache.hadoop.hive.cli.TestSparkCliDriver.org.apache.hadoop.hive.cli.TestSparkCliDriver
 (batchId=109)
org.apache.hadoop.hive.metastore.TestObjectStore.testNotificationOps 
(batchId=201)
org.apache.hadoop.hive.ql.parse.TestExport.shouldExportImportATemporaryTable 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testAlters 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testBasic (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testBasicWithCM 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testBootstrapLoadOnExistingDb
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testBootstrapWithConcurrentDropPartition
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testBootstrapWithConcurrentDropTable
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testConcatenatePartitionedTable
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testConcatenateTable 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testConstraints 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testDrops (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testDropsWithCM 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testDumpLimit 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testEventTypesForDynamicAddPartitionByInsert
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testExchangePartition 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalAdds 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalInsertDropPartitionedTable
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalInsertDropUnpartitionedTable
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalInsertToPartition
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalInserts 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalLoad 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalLoadFailAndRetry
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalLoadWithVariableLengthEventId
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalRepeatEventOnExistingObject
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testIncrementalRepeatEventOnMissingObject
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testInsertOverwriteOnPartitionedTableWithCM
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testInsertOverwriteOnUnpartitionedTableWithCM
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testInsertToMultiKeyPartition
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testRenamePartitionWithCM
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testRenameTableWithCM 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testStatus 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testTruncatePartitionedTable
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testTruncateTable 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testTruncateWithCM 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenarios.testViewsReplication 
(batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenariosAcrossInstances.testBootstrapFunctionReplication
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenariosAcrossInstances.testCreateFunctionIncrementalReplication
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenariosAcrossInstances.testCreateFunctionWithFunctionBinaryJarsOnHDFS
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenariosAcrossInstances.testDropFunctionIncrementalReplication
 (batchId=218)
org.apache.hadoop.hive.ql.parse.TestReplicationScenariosAcrossInstances.testMultipleStagesOfReplicationLoadTask
 (batchId=218)
org.apache.hive.hcatalog.api.TestHCatClient.testReplicationTaskIter 
(batchId=180)
org.apache.hive.hcatalog.api.TestHCatClientNotification.addPartition 
(batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.createDatabase 
(batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.createTable 
(batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.dropDatabase 
(batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.dropPartition 
(batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.dropTable (batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.filter (batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.filterWithMax 
(batchId=232)
org.apache.hive.hcatalog.api.TestHCatClientNotification.getOnlyMaxEvents 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.addPartition 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.alterIndex 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.alterPartition 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.alterTable 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.cleanupNotifs 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.createDatabase 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.createFunction 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.createIndex 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.createTable 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.dropDatabase 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.dropFunction 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.dropIndex 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.dropPartition 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.dropTable 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.exchangePartition 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.filter 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.filterWithMax 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.getOnlyMaxEvents 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.insertPartition 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.insertTable 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.sqlCTAS 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.sqlDb (batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.sqlInsertPartition 
(batchId=232)
org.apache.hive.hcatalog.listener.TestDbNotificationListener.sqlInsertTable 
(batchId=232)
{noformat}

Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/6586/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/6586/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-6586/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 80 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12884316 - PreCommit-HIVE-Build

> HMS log notifications may have duplicated event IDs if multiple HMS are 
> running concurrently
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-16886
>                 URL: https://issues.apache.org/jira/browse/HIVE-16886
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive, Metastore
>            Reporter: Sergio Peña
>            Assignee: anishek
>         Attachments: datastore-identity-holes.diff, HIVE-16886.1.patch, 
> HIVE-16886.2.patch, HIVE-16886.3.patch, HIVE-16886.4.patch, HIVE-16886.5.patch
>
>
> When running multiple Hive Metastore servers and DB notifications are 
> enabled, I could see that notifications can be persisted with a duplicated 
> event ID. 
> This does not happen when running multiple threads in a single HMS node due 
> to the locking acquired on the DbNotificationsLog class, but multiple HMS 
> could cause conflicts.
> The issue is in the ObjectStore#addNotificationEvent() method. The event ID 
> fetched from the datastore is used for the new notification, incremented in 
> the server itself, then persisted or updated back to the datastore. If 2 
> servers read the same ID, then these 2 servers write a new notification with 
> the same ID.
> The event ID is not unique nor a primary key.
> Here's a test case using the TestObjectStore class that confirms this issue:
> {noformat}
> @Test
>   public void testConcurrentAddNotifications() throws ExecutionException, 
> InterruptedException {
>     final int NUM_THREADS = 2;
>     CountDownLatch countIn = new CountDownLatch(NUM_THREADS);
>     CountDownLatch countOut = new CountDownLatch(1);
>     HiveConf conf = new HiveConf();
>     conf.setVar(HiveConf.ConfVars.METASTORE_EXPRESSION_PROXY_CLASS, 
> MockPartitionExpressionProxy.class.getName());
>     ExecutorService executorService = 
> Executors.newFixedThreadPool(NUM_THREADS);
>     FutureTask<Void> tasks[] = new FutureTask[NUM_THREADS];
>     for (int i=0; i<NUM_THREADS; i++) {
>       final int n = i;
>       tasks[i] = new FutureTask<Void>(new Callable<Void>() {
>         @Override
>         public Void call() throws Exception {
>           ObjectStore store = new ObjectStore();
>           store.setConf(conf);
>           NotificationEvent dbEvent =
>               new NotificationEvent(0, 0, 
> EventMessage.EventType.CREATE_DATABASE.toString(), "CREATE DATABASE DB" + n);
>           System.out.println("ADDING NOTIFICATION");
>           countIn.countDown();
>           countOut.await();
>           store.addNotificationEvent(dbEvent);
>           System.out.println("FINISH NOTIFICATION");
>           return null;
>         }
>       });
>       executorService.execute(tasks[i]);
>     }
>     countIn.await();
>     countOut.countDown();
>     for (int i = 0; i < NUM_THREADS; ++i) {
>       tasks[i].get();
>     }
>     NotificationEventResponse eventResponse = 
> objectStore.getNextNotification(new NotificationEventRequest());
>     Assert.assertEquals(2, eventResponse.getEventsSize());
>     Assert.assertEquals(1, eventResponse.getEvents().get(0).getEventId());
>     // This fails because the next notification has an event ID = 1
>     Assert.assertEquals(2, eventResponse.getEvents().get(1).getEventId());
>   }
> {noformat}
> The last assertion fails expecting an event ID 1 instead of 2. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to