Description
Background
When using replicatedTo and replicatedFrom options in Export and Import requests, the AtlasServer stores a marker indicating the next starting point for export to being.
Steps to Duplicate
- Setup export-options.json as follows:
{"itemsToExport": [_}}{{_{ "typeName": "hive_db", "uniqueAttributes": \{ "qualifiedName": "stocks@cl1" }}_}}{{_],"options": {"fetchType": "incremental","skipLineage": true,"changeMarker": 0,"replicatedTo": "SFO$clMain"}} * Perform export using Export REST calls.
- Update export-options.json with the changeMarker from the Atlas' application.log.
- Notice the AtlasServer entry for clMain. It is updated with changeMarker value from log.
- Perform export using Export REST API.
- Export will happen with no entities exported (since nothing was changed in the database). Atlas' application.log indicates new change maker.
Expected results: AtlasServer for clMain should continue displaying REPL_DETAILS entry.
Observed results: AtlasServer for clMain displays properties with REPL_DETAILS entry removed.
Root Cause
Within AuditsWriter, the entry for clMain is saved 2 times. First without the change marker and then if export operation has entities exported, the server entity is saved with the change marker.
If no entities, exist the server entry remains without the REPL_DETAILS entry present.
Possible Fix
Save the target server entry only once.