CMR-11155: Index-set version control -- Part 2/2#2458
Conversation
…-- still not fully working
…rovider for tool and index-set
| concept_id VARCHAR(255) NOT NULL, | ||
| native_id VARCHAR(1030) NOT NULL, | ||
| metadata BLOB NOT NULL, | ||
| format VARCHAR(255) NOT NULL, |
There was a problem hiding this comment.
if the format of the metadata is always the same, do we want this col? I can delete if we assume all metadata is going to be json
There was a problem hiding this comment.
I don't think that we need the format column.
There was a problem hiding this comment.
since the indexer uses the concepts flow, format is required so I have decided to keep it
| cgac/coll-gran-aggregate-cache-key (cgac/create-cache) | ||
| hf/humanizer-cache-key (hf/create-cache-client) | ||
| augmenter/token-sid-cache-name (augmenter/create-token-sid-cache) | ||
| augmenter/token-user-id-cache-name (augmenter/create-token-user-id-cache) |
There was a problem hiding this comment.
Is this because when a request comes in the request Authorization token can be checked?
There was a problem hiding this comment.
I think this was a remanent of an old change I reverted, so I am going to delete this
There was a problem hiding this comment.
Actually, turns out we do need it to gain permissions to look at cache lists and check tokens
The following tests for these permissions under indexer:
cmr.system-int-test.admin.cache-api-test/cache-apis
cmr.system-int-test.admin.admin-permissions-test/ingest-management-permission-test
| clean-combined-index-set (update combined-index-set :index-set dissoc :revision-id :deleted) | ||
| split-index-set-map (split-index-set-by-cluster clean-combined-index-set) | ||
| ;; Save a single unified version to Oracle first to get the revision-id | ||
| revision-id (save-index-set-to-mdb context clean-combined-index-set) |
There was a problem hiding this comment.
Seems like this is saving a revision to Oracle before the validation 4 lines down (validate-requested-index-set), is that correct? Should we validate before saving?
There was a problem hiding this comment.
Yes definitely. I will update this. Good catch
| @@ -942,7 +987,7 @@ | |||
| (put-index-set context combined-index-set)))))) | |||
There was a problem hiding this comment.
Seems like this will result in saving a duplicate revision to the DB during disaster recovery sync. It's reading the latest revision then calling put-index-set which turns around and writes another revision. This could push a genuine revision out of the 10 item limit, up to you if that matters
There was a problem hiding this comment.
Should be fine since the new revision will be the same as the old so we'll still have the right copy
| (index/create-index-set is) | ||
| (is (some? (index/get-index-set-by-id id))) | ||
| ;; Simulate ES loss | ||
| (index/index-set-reset) |
There was a problem hiding this comment.
Suggestion to check the status of this reset call, e.g.: (is (= 204 (:status (index/index-set-reset))))
Because I don't understand how this test is working right now, since calling reset deletes from Oracle as well as removes from ES --> then the sync call below does not restore Oracle tombstones --> then test ends with asserting it is index-set 5555 specifically that was restored.
The suggested line could check for possibility that the reset failed to delete from Oracle
There was a problem hiding this comment.
I have added comments and the extra reset call check
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2458 +/- ##
===========================================
- Coverage 58.06% 29.30% -28.76%
===========================================
Files 1071 1012 -59
Lines 74364 71000 -3364
Branches 2169 1200 -969
===========================================
- Hits 43180 20809 -22371
- Misses 29162 49053 +19891
+ Partials 2022 1138 -884 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Overview
What is the objective?
To allow for disaster recovery and keeping track of historical changes of index-set.
What are the changes?
What areas of the application does this impact?
Indexer
Required Checklist
Additional Checklist