-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Improved membership and reminder tables tests #1488
Conversation
The diff is too large to be viewed in browser, so I'll be back in about 12 hours. Can you give a quickie on what to look for? Say, does this affect how I should handle using storage in #1461? |
@veikkoeeva, this shouldn't affect #1461. I think that best way to approach this change is by comparing the new
|
This seems to be a good time to mention that I've noticed that many tests are being added to the tests projects, which is great. But, there is a lack of consistency. When a test is added, there's no "right" place for it. There are many good tests that only run on Azure and SQL Server. All tests should run on all officially supported platforms. Also, the recently added tests use a configuration different from the tests @veikkoeeva and I wrote. |
@shayhatsor I see the the changes are:
About
I reason it would be good to have it there still as it won't affect It's becoming late, but I hope the comments are clear enough to make sense or to see if they are bogus. |
@shayhatsor About tests. It has come up in Gitter on a few occasions. I believe it was @centur with whom we have briefly chatted (probably with many others too) about this. It would be nice if the tests would be cleaner and refactorend and "always green" when one runs them locally. Not all have all the pieces, such as backing stores, but perhaps those tests could be marked as skipped with the reason that no such store could be used. Otherwise about the tests being applicable across all stores, you are not alone with that idea. We just need someone to write down a plan and see who gets around doing it first. :) About selecting configuration. I think the the non-functioning relational tests are the last batch migrated from VSO and used (still use?) the SQL Server specific I might as record here what I have in mind about configuration selection and storage: Check environment variables so that if in CI server, use some configuration applicable there. If not, use sensible local default values. Especially with regard to relational store, one could test if MySQL has been installed (like this) and/or try to reach it. If no success, do not run MySQL tests. LocalDb is installed by default on Windows and with VS, but it's a different matter when Orleans really get cross-platform. Maybe we could write a set of abstractions that set up one-box deployment, as discussed at #411 and use that in testing as well as running Orleans as Windows service and whatnot. It looks like to me it doesn't need to be much more complicated than this (it has some hardwired configuration etc., but as an idea, have silos and put them into a bunch to create a system). |
@shayhatsor Ah, might not be clear about the refactoring. Apart for some observations (e.g. |
@veikkoeeva, first of all, thanks for your thorough review! now, some comments about your comments:
https://technet.microsoft.com/en-us/library/aa259192%28v=sql.80%29.aspx
it does.
I don't, check out the diff of
that's a really good point, I'll add |
@veikkoeeva Umm it wasn't me. At least reading through this issue it's not something I remember. |
@shayhatsor Ah, one lives, one learns about About the new |
@veikkoeeva, I see your point, this will cause unnecessary contention on the table, and might just not work per the contract in certain edge cases. |
@shayhatsor Summing brings some trouble, or complexity, to this. The scripts has a part that says Basically the problem here is that this isolation level sees a snapshot of the rows in the beginning of a given transaction and so might miss one inserted during it. I think this situation could be remedied by adding
(as an aside, a real world process would not rely on anything like this). The follow-up article is great too. Would this also mean the |
I've read about snapshot reads, it's the default behavior for
We'll only need to add one new column to |
@shayhatsor Where did you find
and these snapshot isolations are by default off. This won't also account for existing server installations (in SQL Server there are databases inside SQL Server databases, inside these databases can be schemas, whereas MySQL these individual databases are considered as schemas, I think). It looks like for MySQL the default is I don't think there will be a problem as such using the
The way I believe this works is that under these settings the Does this make sense? Other question could be that should we make more refactoring that introduce these changes at once, but on the other hand, the most harm I see happens one needs to restart silos (since silodata isn't backwards compatible without separate user action) when updating the relational store. |
@veikkoeeva, I see what you mean. I wrongly used the term "snapshot" where i should have used "read committed", it's enough for our purposes. When a silo reads from the membership table, it can read an "old" state that was changed during the read, just not dirty reads. Also, the data must be eventually consistent.
Each silo holds a local cache of the table. Each silo state entry in the cache must have the following property: I am working on a solution that wouldn't require any migration script. |
@shayhatsor No problem here. I think we're on the same page provided It occurred to me that there's already one way of doing it and one option would be to leave it as-is. Then do a separate PR that refactors much more of the issues, such as statistics and maybe other structures, such as suspecting*. I'm not sure what comes from the geo-distribution PR either: #948 and if it'd require "difficult changes". |
It would be useful to know if there is already critical usage of the relational backend and if it were useful to keep the data or is it OK to wipe it and restart silos. As there isn't yet streams or state provider data on relational, it would look plausible migrating silo data isn't that critical. What would @sergeybykov say? From whom should these be asked? :) |
@veikkoeeva My impression is that Gigya folks were first who were serious about using SQL-based system store. There are could be other users that never surfaced and are running Orleans in "stealth" mode. So far we've erred on the "move fast" side not making backward compatibility between releases a requirement. I think we can flag this in release notes. |
@sergeybykov, from Gigya's perspective, making breaking changes in the relational implementation are currently OK. Current systems that are in production use reminders only as a backup. |
Good. Is this ready to be merged then? |
I've added many test cases not covered previously and refactored the base test classes. Added same tests for Azure, in order to have a good base case. this will help with refactoring and simplifying relational storage including the SQL scripts. @sergeybykov this PR only contains refactored and improved tests, it is ready for review and merge. |
Improved membership and reminder tables tests
Thank you, @shayhatsor! The tests look and are organized much cleaner now. |
This is what I came up with while refactoring the sql queries to be as similar/simple as possible.
The new code is backwards compatible with the old sql queries.
Added some new tests, those revealed two minor bugs in the MySQL script, and one minor bug in the MSSQL script. @veikkoeeva please take a look. also these changes shouldn't conflict with #1461.