phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2647) Duplicate results in reverse scan when guideposts are traversed
Date Fri, 05 Feb 2016 17:59:39 GMT

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

James Taylor commented on PHOENIX-2647:
---------------------------------------

Great work, [~ankit.singhal]! +1 with one minor test change - you can't set guidepost depth
in a BaseClientManagedTimeIT test, as it'll affect all tests that run after this one (since
the mini server is kept up across tests). Given that you already have a simpler repro, let's
just keep your new tests and revert the changes to OrderByIT.

> Duplicate results in reverse scan when guideposts are traversed
> ---------------------------------------------------------------
>
>                 Key: PHOENIX-2647
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2647
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.4.0
>            Reporter: Maryann Xue
>            Assignee: Ankit Singhal
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-2647.patch, PHOENIX-2647_wip.patch
>
>
> This problem seems to only occur with reverse scan not forward scan. Adding the below
tests and settings in OrderByIT can reproduce the issue. I ended up getting two rows of "ROW7"
instead of one.
> {code}
>     
>     @BeforeClass
>     public static void doSetup() throws Exception {
>         Map<String,String> props = getDefaultProps();
>         props.put(QueryServices.RUN_UPDATE_STATS_ASYNC, Boolean.FALSE.toString());
>         props.put(QueryServices.COMMIT_STATS_ASYNC, Boolean.FALSE.toString());
>         props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(1000));
>         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
>     }
>     @Test
>     public void testReverseScan() throws Exception {
>         long ts = nextTimestamp();
>         String tenantId = getOrganizationId();
>         initATableValues(tenantId, getDefaultSplits(tenantId), null, ts);
>         String query = "SELECT entity_id FROM aTable ORDER BY organization_id desc";
>         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
>         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 2));
// Execute at timestamp 2
>         Connection conn = DriverManager.getConnection(getUrl(), props);
>         conn.createStatement().execute("UPDATE STATISTICS ATABLE");
>         conn.commit();
>         conn.close();
>         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5));
// Execute at timestamp 2
>         conn = DriverManager.getConnection(getUrl(), props);
>         try {
>             PreparedStatement statement = conn.prepareStatement(query);
>             ResultSet rs = statement.executeQuery();
>             assertTrue (rs.next());
>             assertEquals(ROW9,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW8,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW7,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW6,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW5,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW4,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW3,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW2,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW1,rs.getString(1));
>             assertFalse(rs.next());
>         } finally {
>             conn.close();
>         }
>     }
> {code}



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

Mime
View raw message