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

Update of metadata during a replication fails when base path is not matched in all partitions #212

Open
patduin opened this issue Feb 15, 2021 · 1 comment
Assignees

Comments

@patduin
Copy link
Contributor

patduin commented Feb 15, 2021

Sometimes replication fails with an error like:

Caused by: com.hotels.bdp.circustrain.api.CircusTrainException: Partition path 's3://bucket/db/table/1539359466542/acquisition_instant=20181012T155106Z' does not seem to belong to data source path 's3://bucket/table'

Or something similar. This is caused by a check in the code that tries to create the target partition location based on the source location layout. If possible this should be fixed in the metadata of the source table. But since the data is actually copied it would be nice if Circus Train can make an estimate on what the path should look like.

The underlying issue is that we have several places where we check try to estimate a relative path based on the base table location. This means that if partitions don't share a base location we cannot replicate it.

We should improve Circus Train to allow replication even if this is the case.
We need to rewrite the Copiers and HdfsSnapshotLocationManager to generate the partition locations that need to be replicated + the matching partition name (we can use Hive's Warehouse class for that). A Copier can use that information to generate the output location for the data.

This implies we don't copy the input folders anymore from the source so for instance given this:

Table partition by column year:String.

Base: s3://base/db/table/
Partition1 = s3://base/db/table/year=2020/
Partition2 = s3://base2/table/year=2021/

This would result in:

Replication base location= s3:/target/db/table/
Partition1 = s3:/target/db/table/year=2020/
Partition2 = s3:/target/db/table//year=2021/

But also:

Base: s3://base/db/table/
Partition1 = s3://base/db/table/a/b/c/year=2020/

This would result in:

Replication base location= s3:/target/db/table/
Partition1 = s3://target/db/table/year=2020/

^ Currently we can replicate this and we keep a/b/c in the path, this would change.

@patduin patduin self-assigned this Feb 15, 2021
@massdosage massdosage changed the title Replication (metadata update) fails when base path it not matched in all paritions Replication (metadata update) fails when base path is not matched in all paritions Feb 18, 2021
@massdosage massdosage changed the title Replication (metadata update) fails when base path is not matched in all paritions Update of metadata during a replication fails when base path is not matched in all paritions Feb 18, 2021
@massdosage
Copy link
Contributor

We should see whether we can make this behaviour configurable for backwards compatibility.

Do you want to add the event ids to the above paths or leave them out for simplicity? A good use case to test this out would be a two step replication, currently the final target would have two event ids in the location paths, with this change it would only have one (that of the second replication).

@patduin patduin changed the title Update of metadata during a replication fails when base path is not matched in all paritions Update of metadata during a replication fails when base path is not matched in all partitions Feb 26, 2021
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 a pull request may close this issue.

2 participants