-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Tenant removal (Lombiq Technologies: OCORE-96) #11890
Conversation
How does it work with multiple Azure instances? |
With the |
We may need to have something like a "DROP Database" and "DROP Table" dialect in YesSql. Which would result in a different operation for SQLite of course. |
Yes maybe, will see, I may need your help in this area ;) |
As for removing the proper tables, maybe the migrations themselves should have their own Remove() method per module. This method could evolve over time if needed. Or, keep a dictionary of tables used by each module in the MigrationData. |
I was on waiting state after my comment here ;) It's great to see the PR started again |
src/OrchardCore/OrchardCore/Shell/Configuration/ShellConfigurationSources.cs
Outdated
Show resolved
Hide resolved
Just for info. So for now only first testing codes where I tried to apply the ideas of my first comment.
|
So, for a given Tenant we can replay the data migrations (of all installed features) but by using a custom For now only tried with Sql Server. |
For info, it also works with
|
For info about removing There is a file lock per index which is created when the index is updated (e.g. on publishing a related indexed item). These file locks are released when the tenant is released, which is the case when we want to reload it, or when we disable it. For now I opted to disable a tenant before removing it, so that the tenant is no more served and we can still create internally an isolated shell context on it, e.g. with a minimum set of features or all installed features, this depending on the stuff to do. So here if the tenant is disabled (so released), the |
I will check asap this part. About your review, I will check again each suggestion, already did some of them. |
Yes, as it would do if we try to Enable this Disabled tenant. But in this context I will see if we can capture this exception and have an error message instead, as we do for other exceptions while removing.
Currently an exception is thrown but nothing is removed.
Hmm, unless it is an indinvidual file for sqlite, if the database is the harder part to remove maybe better to let the tenant as is, allowing to fix the connection and retry it. Hmm, if not using sqlite, most of the time tenants are sharing the same database (but yes not necessarily), if so normally the connection is valid. |
…al, add error message
Okay, so in that case we capture the exception and display an error message instead (still log the error). |
I did some last changes related to your review, maybe some remaining things but not related to this PR, being just some copy paste from how it is done everywhere else. Let me know if I missed something, otherwise if you can approve. |
@jtkech please make sure the minor agreed on changes are done. But I tested it and approved it |
Yes the requested changes by @Piedone (only typos) are still red and I lost his approval, but I committed his suggestions, will see.
Thanks |
src/OrchardCore/OrchardCore/Shell/Removing/ShellSiteFolderRemovingHandler.cs
Outdated
Show resolved
Hide resolved
@Piedone Okay, I updated the log message as you requested, the PR needs to be approved again ;) |
@jtkech I upgrade an instance that was using 1.5 to 1.6 preview. Media are stored on Azure Blob Storage. After deployment, none one the images are loading correctly. The images are in the Blob storage by the website show as the images do not exists. Could the change in this PR broke the Media Azure services? |
From memory in this module we only add Then to not have nested blocks I used at the beginning of
Then did the same in
But the logic seems to be still okay, hmm but seems to not be related if you say that the blob contains the images. Otherwise nothing else was changed in this module as I can remember. |
@jtkech not sure what could it be. I don't see anything in the logs. Any idea why wouldn't this connect to the blob storage? |
Will see, maybe only a little missing thing. First we also change the path where files are cached, in place of all under |
Can you connect to your blob outside of OC with the same connection string? |
Fixes #1212, related to #8471
Fixes #11989.