Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect scan range in Accumulo shell getsplits command. #2356

Closed
bmcclureii opened this issue Nov 11, 2021 · 0 comments · Fixed by #2369 or #2370
Closed

Incorrect scan range in Accumulo shell getsplits command. #2356

bmcclureii opened this issue Nov 11, 2021 · 0 comments · Fixed by #2369 or #2370
Assignees
Labels
bug This issue has been verified to be a bug.

Comments

@bmcclureii
Copy link

I have experienced an issue using the getsplits command in the accumulo shell. It occurs when the tableId of the table happens to be a single letter ("w" for example ) and there are other tables in the system that start with that letter ("w1", "w3" for example). The result is the output of getsplits is displaying splits for other tables. This has produced outputs with multiple default tablets for example and has been demonstrated in multiple installations.

Looking at the current getsplits code,

final Text start =
new Text(shellState.getAccumuloClient().tableOperations().tableIdMap().get(tableName));
final Text end = new Text(start);
end.append(new byte[] {'<'}, 0, 1);
scanner.setRange(new Range(start, end));

it seems to be scanning a range where the start and end of the range are: , +'<'. For our example above this amounts to:
accumulo shell -u
table
scan -b w -e w<

And this can be shown to pick up tablets from tables w1, w3 etc.

Versions
Affected version(s) of this project: 1.9.2 but seems to be still in the code-base as of Nov 12 2021

To Reproduce
1. Require to have a table with a single character tableId such as w or 3 and a table with a multiple character tableId that start with it, such as w1 or 33.
2. accumulo shell -u <user>
3. table <table>
4. getsplits -v -o /tmp/splits.txt
5. See error: There may be observed splits for tables that are not the current table.

Expected behavior
Only splits for the current table should be displayed.

Fix
It has been suggested to add a line after line 73 above:
start.append(new byte[] {';'}, 0, 1);

@bmcclureii bmcclureii added the bug This issue has been verified to be a bug. label Nov 11, 2021
@jmark99 jmark99 assigned jmark99 and unassigned jmark99 Nov 15, 2021
@ctubbsii ctubbsii added this to To do in 1.10.2 via automation Nov 19, 2021
@ctubbsii ctubbsii added this to To do in 2.1.0 via automation Nov 19, 2021
jmark99 added a commit to jmark99/accumulo that referenced this issue Nov 29, 2021
In the Accumulo shell, calling getsplits with the verbose option can
result in incorret output. It occurs when the tableId of the table
happens to be a single character and there are other tables where the
tableId starts with the same character. This results in the output of
getsplits displaying splits for the other tables as well.

Closes apache#2356
jmark99 added a commit to jmark99/accumulo that referenced this issue Nov 29, 2021
In the Accumulo shell, calling getsplits with the verbose option can
result in incorret output. It occurs when the tableId of the table
happens to be a single character and there are other tables where the
tableId starts with the same character. This results in the output of
getsplits displaying splits for the other tables as well.

Closes apache#2356
jmark99 added a commit to jmark99/accumulo that referenced this issue Nov 29, 2021
Correcting some formatting issues.

Closes apache#2356
2.1.0 automation moved this from To do to Done Nov 29, 2021
1.10.2 automation moved this from To do to Done Nov 29, 2021
jmark99 added a commit that referenced this issue Nov 29, 2021
In the Accumulo shell, calling getsplits with the verbose option can result in incorret output. It occurs when the tableId of the table happens to be a single character and there are other tables where the tableId starts with the same character. This results in the output of getsplits displaying splits for the other tables as well.

Closes #2356

Co-authored-by: Mike Miller <mmiller@apache.org>
jmark99 added a commit that referenced this issue Nov 29, 2021
In the Accumulo shell, calling getsplits with the verbose option can result in incorret output. It occurs when the tableId of the table happens to be a single character and there are other tables where the tableId starts with the same character. This results in the output of getsplits displaying splits for the other tables as well.

Added a couple of grammatical fixes based upon @millerruntime suggestions.

Closes #2356
@ctubbsii ctubbsii linked a pull request Nov 30, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue has been verified to be a bug.
Projects
No open projects
1.10.2
  
Done
2.1.0
  
Done
2 participants