Fixing supersededBy issue for SHARED partition
There is a defect in the Azure module of AzureSchemaInfoStore.java.
Steps to replicate:
- Create a schema with a schema with
SHAREDdata-partition withsupersededByblock. - Now, invoke schema GET endpoint with appropriate filters:
authority,source,entityTypeandschemaVersionMajorusingPRIVATEpartition. This call would fail because the search forsupersededByblock happens in thePRIVATEpartition where it doesn't exist.
Root Cause
Below code make a call to getSchemaInfoObject(info.getFlattenedSchemaInfo()) without passing the dataPartitionID and it always looks for supersededBy block in the datapartition specified in the header (in this case PRIVATE where it doesn't exist):
List<SchemaInfo> schemaList = new LinkedList<>();
for (SchemaInfoDoc info: schemaInfoList)
{
schemaList.add(getSchemaInfoObject(info.getFlattenedSchemaInfo()));
}
FIX
Additional attribute i.e dataPartitionId should be supplied which will look for supersededBy block in the correct dataPartition always.
Issue
Edited by Abhishek Kumar (SLB)