----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74951/#review226374 -----------------------------------------------------------
As per the changes in this patch, in case if no entities are found in the export, the export service will respond with an empty zip file with no files within and status code 204. Contradicting to this, behaviour as seen in the previous version for similar case of empty export is such : The export API call returns 3 json files (atlas-typesdef.json, atlas-export-order.json and atlas-export-info.json) in the zip output response with response code 200 and operation status "FAIL" Remark : Backward compatibility needs to be taken care of while handling empty export/zero delta for incremental export. Also, Operation Status to be marked as SUCCESS for every successful execution (even if there are no entities found for any request) unless there occurs any exception/error in the flow Suggestion : Make the changes based on a flag/setting which indicates an empty export; like so : omitZipResponseForEmptyExport ; the content-type in the response may also need to be set acccordingly - Sheetal Shah On April 2, 2024, 8:20 p.m., Priyanshi Shah wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/74951/ > ----------------------------------------------------------- > > (Updated April 2, 2024, 8:20 p.m.) > > > Review request for atlas, Jayendra Parab, Mandar Ambawane, Pinal Shah, and > Sheetal Shah. > > > Bugs: ATLAS-4845 > https://issues.apache.org/jira/browse/ATLAS-4845 > > > Repository: atlas > > > Description > ------- > > Steps: > > 1. First export and import with changeMarker “0” - worked as expected. > 2. Try to run 2nd export + import without any changes in atlas, 2nd export > also worked and gave different changeMarker in output as expected. > > Expectation: > > a) Empty zip should be created if no entities is fetched. > > Problem: > > 2nd Import is getting failed. > > Solution: > > 1. Earlier export zip was created with default json files like > atlas-export-info.json, atlas-export-order.json and atlas-typesdef.json when > though no entities was fetched and hence, while performing import opertaion > failure was seen with Empty Zip File exception. > 2. Now, the problem is fixed by returning empty zip files if no entities was > fetched and the status code is set to 204. > > > Diffs > ----- > > repository/src/main/java/org/apache/atlas/repository/impexp/ZipSink.java > 5cec39dd6 > webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java > 3a7777a24 > > > Diff: https://reviews.apache.org/r/74951/diff/1/ > > > Testing > ------- > > Manual testing for the same has been performed. > > PC is also successfull. > > https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/1589/ > > > Thanks, > > Priyanshi Shah > >