Conversation
Set default for WipeElementType type_ Co-authored-by: Metin Cakircali <11517091+mcakircali@users.noreply.github.com>
Feature/fdb 614 daos wipe refactor
4b98995 to
a4e6af0
Compare
FDB-508 Fix merge of daos wipe changes
a4e6af0 to
51e1f9d
Compare
This is of particular relevance when an FDB has been reindexed, as this means there are essentially two catalogues for one store. Extended reindex test to also wipe the FDB.
…few enhancements in wipe tests.
Also run clang format
Tests have had to be further updated to account for the bug reported in FDB-633 being fixed, as this has increased the number of index files written when subtocs are used. format
simondsmart
left a comment
There was a problem hiding this comment.
Super happy with this. Only very minor comments, and happy for it to be merged without my re-review after this.
Can you make sure that we include the diagrams that you drew of the overall wipe process/structure, and reference these in an obvious comment at the wipe entry point. There is a lot of implicit overall flow/state knowledge which is needed to work on this code, and we want to give any future developers a heads up...
| [](const auto& pair) { return !pair.second.empty(); }); | ||
|
|
||
| if (doit && unclean && !unsafeWipeAll) { | ||
| eckit::Log::warning() << "Unclean FDB database has the following unknown URIs:" << std::endl; |
There was a problem hiding this comment.
If we are going to error out here, throwing an exception, then this should probably go to Log::error()
| CatalogueWipeState catalogueWipeState; | ||
| while (it.next(catalogueWipeState)) { | ||
|
|
||
| auto elements = coordinator.wipe(catalogueWipeState, doit, unsafeWipeAll); |
There was a problem hiding this comment.
The elements here are constructed inside the coordinator. Consider whether we should just pass the queue to coordinator, and have it push directly? (This may be a bad idea, but it looks to me like the output elements are all constructed after the action has taken place so it should be functionally equivalent?)
There was a problem hiding this comment.
I think this is a sensible suggestion
| #include "eckit/filesystem/PathName.h" | ||
|
|
||
| template <> | ||
| struct std::hash<eckit::URI> { |
There was a problem hiding this comment.
This probably belongs in eckit in URI.h
There was a problem hiding this comment.
It's definitely a bit random to see it in WipeVisitor.h... I wonder if it is still used.
| #include "eckit/filesystem/PathName.h" | ||
|
|
||
| template <> | ||
| struct std::hash<eckit::URI> { |
There was a problem hiding this comment.
Note that specialising std::hash (or anything else) is the one thing that should be done inside namespace std!!!
| #include "eckit/filesystem/PathName.h" | ||
|
|
||
| template <> | ||
| struct std::hash<eckit::URI> { |
There was a problem hiding this comment.
This should almost certainly be in eckit, in URI.h
Note that specialising a template in namespace std is the one thing that you should be doing inside namesapace std.
| catalogueWipeState_.catalogue(catalogue.config()); | ||
|
|
||
| // Build the initial control state (is there really not a function for this?) | ||
| ControlIdentifiers id; |
There was a problem hiding this comment.
It doesn't look like it. But do have a look at the constructor ControlElement::ControlElement(const Catalogue&) - which should probably be abstracted to somewhere else.
| catalogueWipeState_.excludeData(dataURI); | ||
| } | ||
| } | ||
| return true; |
There was a problem hiding this comment.
This returns true, but I don't see us having (or needed) calls to visitDatum anywhere?
| bool TocStore::doWipeUnknowns(const std::set<eckit::URI>& unknownURIs) const { | ||
| for (const auto& uri : unknownURIs) { | ||
| if (uri.path().exists()) { | ||
| remove(uri, eckit::Log::info(), eckit::Log::info(), true); |
There was a problem hiding this comment.
Note that we have "using namespace eckit" at the top of this file. We can tidy quite a lot of eckit:: in this file.
|
|
||
| //---------------------------------------------------------------------------------------------------------------------- | ||
|
|
||
| StdDir::StdDir(const eckit::PathName& p) : path_(p), d_(opendir(p.localPath())) { |
There was a problem hiding this comment.
This is copied from elsewhere, no? Is it not possible to put this somewhere sane for common use?
There was a problem hiding this comment.
IIRC FDB's StdDir is confusingly functionally distinct from eckit's StdDir. But I should check.
Adds [CATALOGUE] and [STORE] to the revelevant server logs to allow for better filtering when debugging. Also enable FDB_DEBUG for the server tests, as the serverside logs are otherwise quite sparse and not useful for debugging.
And minor change to remote_api test logging and modify it such that client sleeps while the server flushes the consolidated index.
665faee to
3560b41
Compare
Description
Some caveats:
--unsafe-wipe-allwill hit an assert(false) on remote FDB, as I do not want this functionality supported without better testing / some discussion.Contributor Declaration
By opening this pull request, I affirm the following:
🌈🌦️📖🚧 Documentation 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/fdb/pull-requests/PR-184
🌈🌦️📖🚧 Documentation Z3FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/z3fdb/pull-requests/PR-184
🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/dev-section/fdb/pull-requests/PR-184