-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate metastore to code generated metastore service #3898
Conversation
a4d7a3e
to
baebca5
Compare
c665a7f
to
1e66102
Compare
ee70464
to
ca832cc
Compare
ca832cc
to
148460a
Compare
.await; | ||
let delete_splits_request = DeleteSplitsRequest { | ||
index_uid: index_uid.to_string(), | ||
split_ids: split_ids.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we need to clone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the error message, is that what you mean?
I'm fine with removing it, we return the appropriate metastore error that we could log instead.
77c80df
to
89e8c1a
Compare
cache: Arc<Mutex<HashMap<Uri, Weak<dyn Metastore>>>>, | ||
// We never garbage collect unused metastore client instances. This should not be a problem | ||
// because during normal use this cache will hold at most a single instance. | ||
cache: Arc<Mutex<HashMap<Uri, MetastoreServiceClient>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is true, maybe we should use an Arc<Mutex<Option<(Uri, MetastoreServiceClient)>>>
and always evict the old client if URIs don't match (and log a warning?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea and I tested it. Only a few tests are failing if we changed this. We need to also to refactor the factory as now the code between the file backed factory cache and the postgres factory cache is exactly the same.
quickwit/quickwit-metastore/src/metastore/postgresql_metastore.rs
Outdated
Show resolved
Hide resolved
storage_resolver: &StorageResolver, | ||
index_id: &str, | ||
source_config_opt: Option<&SourceConfig>, | ||
) -> anyhow::Result<()> { | ||
let mut checks: Vec<(&str, anyhow::Result<()>)> = Vec::new(); | ||
|
||
// The metastore is file-backed, so we must check the storage first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is useless. The check connectivity of the metastore will do the right check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave it. The checklist will tell you it's a metastore issue, whereas it stems from the storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will change the comment then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to do the right check in the metastore method and make sure the error displayed is clean.
0f530a6
to
4c43b9b
Compare
dc1abe3
to
7655fb0
Compare
TODO
IndexUid
check_connectivity
anduris
methods (add a new traitMetastoreServiceExt
?)index_exists
methodMetastoreServiceClient::new(mock_metastore)
, but we need to wrap the mock. Also it's possible to doMockMetastoreService::new()
and I think we don't want a developer to do that => I added an assert if a dev instantiate withMetastoreServiceClient::new
instead ofMetastoreServiceClient::from
.Some proto requests have aThe solution would be to have only optional fields....default
implementation that will generate an empty json payload, this is badNext steps:
Service<R>
for each metastore request on the control plane client. I don't have a concrete plan on this and prefer to open an issue to fix it later. I may miss an obvious solution, let's discuss that tomorrow.ListSplitsRequest::try_from_index_uid
byListSplitsRequest::from_index_uid
as we are sure this builder won't fail.