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
SHARED
data-partition withsupersededBy
block. - Now, invoke schema GET endpoint with appropriate filters:
authority
,source
,entityType
andschemaVersionMajor
usingPRIVATE
partition. This call would fail because the search forsupersededBy
block happens in thePRIVATE
partition 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)