Skip to content

Conversation

@ashvina
Copy link
Collaborator

@ashvina ashvina commented Nov 9, 2019

Tiered block reads fail on DNs when FS caching is disabled and the
remote store requires credentials. This happens because the DN searches
the wrong remoteFS. For e.g. there is a default provided volume created
on DN. It uses the same alias map as other provided volumes. However it
uses the default conf object. While reading a block, the volume filds
the FileRegion for the required block from alias map. However, creation
of a secured file system object will fail as the config object will not
contain the desired credentials. So the DN will fail the read.

Ashvin Agrawal and others added 2 commits November 9, 2019 08:12
…here

Issue: Warning messages in DN logs, e.g. Exception in retrieving ReplicaInfo for block id XXXXX

Cause: The datanode searches for the requested block in all storage volumes including mounted directories. The mounted volume search writes a warning log message when the block is not found even if the block was supposed to be missing, new block for e.g.

Fix:
1. Replace a warning message with a debug log for missing blocks in mounted dirs
2. Prioritize searching the block in local dirs before looking in mounted dirs. This may avoid unnecessary lookups.
Tiered block reads fail on DNs when FS caching is disabled and the
remote store requires credentials. This happens because the DN searches
the wrong remoteFS. For e.g. there is a default provided volume created
on DN. It uses the same alias map as other provided volumes. However it
uses the default conf object. While reading a block, the volume filds
the FileRegion for the required block from alias map. However, creation
of a secured file system object will fail as the config object will not
contain the desired credentials. So the DN will fail the read.
@ashvina ashvina marked this pull request as ready for review November 9, 2019 16:25
@ashvina ashvina requested a review from virajith November 9, 2019 16:26
Copy link

@virajith virajith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, which is the actual fix for the problem you mention with the fs cache disable bug? I seem to be missing something here.

fsVolume.addBlockPool(bpid, config, this.timer);
tempVolumeMap.addAll(
fsVolume.getVolumeMap(bpid, fsVolume, ramDiskReplicaTracker));
tempVolumeMap =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only those in the last nsInfo will go into the tempVolumeMap?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier, addAll was adding all the k-v in the ProvidedVolumeReplicaMap into the VolumeReplicaMap (tempVolumeMap ). Which means the replicaMap associated with the ProvidedVolume will still be of type VolumeReplicaMap and not ProvidedVolumeReplicaMap. The ProvidedVolume will never invoke aliasMap request if it is not connected to ProvidedVolumeReplicaMap.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the semantics associated with the {{for (final NamespaceInfo nsInfo : nsInfos) }} is not the same as before right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I will fix this this. Thanks !

@ashvina
Copy link
Collaborator Author

ashvina commented Nov 14, 2019

Regarding your question about the relation between the failure and fs.cache, the fix has two paths

Part 1:
Currently [PROVIDED]file:/// volume is added by default. When the FsDataset starts looking for a block, it can start with this default volume and will eventually follows the following path
ProvidedVolumeReplicaMap.getReplicaFromAliasMap -> ReplicaBuilder.build -> new FinalizedProvidedReplica -> new ProvidedReplica -> FileSystem.get (abfs://)

Note that an abfs block is searched for in the [PROVIDED]file:/// volume. While constructing the ProvidedReplica if the fs cache is enabled, FileSystem.get (abfs://) succeeds for [PROVIDED]file:/// since it already exists in the cache. The cached FS is returned even though the abfs credentials are not available with the file volume.

Hence one part of the fix is to search for block presence early enough and terminate the flow with ReplicaRemoteFSMismatchException

Part 2:
The type of the ReplicaMap associated with any Provided volume should be ProvidedReplicaMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants