drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5044) After the dynamic registration of multiple jars simultaneously not all UDFs were registered
Date Tue, 29 Nov 2016 13:37:58 GMT

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

ASF GitHub Bot commented on DRILL-5044:
---------------------------------------

Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/669#discussion_r89995323
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/TestDynamicUDFSupport.java ---
    @@ -271,6 +271,75 @@ public void testDuplicatedFunctionsInLocalRegistry() throws Exception
{
       }
     
       @Test
    +  public void testSuccessfulRegistrationAfterSeveralRetryAttempts() throws Exception
{
    +    RemoteFunctionRegistry remoteFunctionRegistry = spyRemoteFunctionRegistry();
    +    copyDefaultJarsToStagingArea();
    +
    +    doThrow(new VersionMismatchException("Version mismatch detected", 1))
    +            .doThrow(new VersionMismatchException("Version mismatch detected", 1))
    +            .doCallRealMethod()
    +            .when(remoteFunctionRegistry).updateRegistry(any(Registry.class), any(DataChangeVersion.class));
    +
    +    String summary = "The following UDFs in jar %s have been registered:\n" +
    +            "[custom_lower(VARCHAR-REQUIRED)]";
    +
    +    testBuilder()
    +            .sqlQuery("create function using jar '%s'", default_binary_name)
    +            .unOrdered()
    +            .baselineColumns("ok", "summary")
    +            .baselineValues(true, String.format(summary, default_binary_name))
    +            .go();
    +
    +    verify(remoteFunctionRegistry, times(3))
    +            .updateRegistry(any(Registry.class), any(DataChangeVersion.class));
    +
    +    FileSystem fs = remoteFunctionRegistry.getFs();
    +
    +    assertFalse("Staging area should be empty", fs.listFiles(remoteFunctionRegistry.getStagingArea(),
false).hasNext());
    +    assertFalse("Temporary area should be empty", fs.listFiles(remoteFunctionRegistry.getTmpArea(),
false).hasNext());
    +
    +    assertTrue("Binary should be present in registry area",
    +            fs.exists(new Path(remoteFunctionRegistry.getRegistryArea(), default_binary_name)));
    +    assertTrue("Source should be present in registry area",
    +            fs.exists(new Path(remoteFunctionRegistry.getRegistryArea(), default_source_name)));
    +
    +    Registry registry = remoteFunctionRegistry.getRegistry();
    +    assertEquals("Registry should contain one jar", registry.getJarList().size(), 1);
    +    assertEquals(registry.getJar(0).getName(), default_binary_name);
    +  }
    +
    +  @Test
    +  public void testSuccessfulUnregistrationAfterSeveralRetryAttempts() throws Exception
{
    +    RemoteFunctionRegistry remoteFunctionRegistry = spyRemoteFunctionRegistry();
    +    copyDefaultJarsToStagingArea();
    +    test("create function using jar '%s'", default_binary_name);
    +
    +    reset(remoteFunctionRegistry);
    +    doThrow(new VersionMismatchException("Version mismatch detected", 1))
    --- End diff --
    
    It's Mockito functionality. You can mock the method to return failure or any result when
it is being called.
    In this case we mock `updateRegistry()` method to return VersionMismatchException first
two times. This way we simulate the situation that someone has updated remote function registry
before us.
    After that we instruct to call real method.


> After the dynamic registration of multiple jars simultaneously not all UDFs were registered
> -------------------------------------------------------------------------------------------
>
>                 Key: DRILL-5044
>                 URL: https://issues.apache.org/jira/browse/DRILL-5044
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.9.0
>            Reporter: Roman
>            Assignee: Arina Ielchiieva
>
> I tried to register 21 jars simultaneously (property 'udf.retry-attempts' = 30) and not
all jars were registered. As I see in output, all function were registered and /staging directory
was empty, but not all of jars were moved into /registry directory. 
> For example, after simultaneously registration I saw "The following UDFs in jar test-1.1.jar
have been registered: [test1(VARCHAR-REQUIRED)" message, but this jar was not in /registry
directory. When I tried to run function test1, I got this error: "Error: SYSTEM ERROR: SqlValidatorException:
No match found for function signature test1(<CHARACTER>)". And when I tried to reregister
this jar, I got "Jar with test-1.1.jar name has been already registered".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message