[
https://issues.apache.org/jira/browse/HDFS-6198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13962233#comment-13962233
]
Chris Nauroth commented on HDFS-6198:
-------------------------------------
If we were just doing {{File.separator + "BPstuff" + File.separator}}, then the
regex would be invalid. We'd get an exception while trying to parse the regex.
Wrapping it with {{Pattern.quote}} is what makes it safe. This injects {{\Q}}
and {{\E}} for literal character quoting. On Linux/Mac, the final pattern is:
{code}
^(.*)(\Q/\EBP-\d+-\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}-\d+\Q/\E)(current)(.*)$
{code}
On Windows, the final pattern is:
{code}
^(.*)(\Q\\EBP-\d+-\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}-\d+\Q\\E)(current)(.*)$
{code}
Thanks for the tip on {{TestBlockPoolSliceStorage}}. I'll take a look at that
one and provide a new patch.
> DataNode rolling upgrade does not correctly identify current block pool
> directory and replace with trash on Windows.
> --------------------------------------------------------------------------------------------------------------------
>
> Key: HDFS-6198
> URL: https://issues.apache.org/jira/browse/HDFS-6198
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: datanode
> Affects Versions: 3.0.0, 2.4.0
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
> Attachments: HDFS-6198.1.patch
>
>
> For rolling upgrade, the DataNode uses a regex to identify the current block
> pool directory and replace it with the equivalent trash directory. This
> regex hard-codes '/' as the file path separator, which doesn't work on
> Windows.
--
This message was sent by Atlassian JIRA
(v6.2#6252)