- Issue created by @catch
- Merge request !7061Implement the lazy database creation pattern for sessions. β (Open) created by catch
- Status changed to Needs review
9 months ago 4:03pm 15 March 2024 - Status changed to Needs work
9 months ago 5:14pm 15 March 2024 - πΊπΈUnited States phenaproxima Massachusetts
Seems relatively straightforward, but I have some complaints about the code. :)
- Status changed to Needs review
9 months ago 9:56am 16 March 2024 - π«π·France andypost
Looks in combination with β¨ provide an API to forcibly start a session Needs work there will be single place for sessions to start and create its storage
- Status changed to Needs work
9 months ago 1:59pm 16 March 2024 - πΊπΈUnited States phenaproxima Massachusetts
A few more small points/questions, but otherwise this is probably ready. Since this is an internal refactoring and tests are passing, I don't think it needs explicit test coverage. But it might need a change record...?
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
One fun thing with these auto created tables is restoring a database when the site is under load.
Found that out the hard way when the restore died 80% through because the key value table had auto created itself. Solution was to shutdown the nginx server as well.
- πΊπΈUnited States phenaproxima Massachusetts
Ensuring @catch is credited for the patch, and I'm credited for my impeccable code review (hah!)
- Status changed to Needs review
9 months ago 10:58am 18 March 2024 - π¬π§United Kingdom catch
We should probably open a follow-up to bring some of the other subsystems that implement this up-to-date with SchemaObectNotExistsException etc., I think they were added after we started doing this.
- Status changed to RTBC
9 months ago 12:32pm 18 March 2024 - πΊπΈUnited States phenaproxima Massachusetts
No objections here.
Should we remove the
sessions
table fromsystem_schema()
in this MR, per the change record? - πΊπΈUnited States phenaproxima Massachusetts
- Status changed to Needs work
9 months ago 1:31pm 18 March 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Don't we need to remove sessions from system_schema - otherwise we have to maintain the schema in two locations which seems wrong. Plus we're not really using the changes here if we're still creating the table during system module install.
- Status changed to Needs review
9 months ago 3:14pm 18 March 2024 - π¬π§United Kingdom catch
Don't know how I missed the most important and most satisfying part of the change...
- π¬π§United Kingdom catch
OK the answer to 'why doesn't this use
SchemaObjectDoesNotExistException
is that that exception is only thrown when you try to change a schema object that doesn't exist (like altering a table or something), not when just querying from a table that doesn't exists, so went back to\Throwable
in the MR.@phenaproxima I had already opened π Update lazy database creation pattern for more specific exceptions etc. Active , we should consolidate those two and not mention
SchemaObjectDoesNotExistException
. - Status changed to RTBC
9 months ago 3:43pm 18 March 2024 - πΊπΈUnited States phenaproxima Massachusetts
Huh, too bad about SchemaObjectExistsException. The change to Throwable makes sense. RTBC assuming all tests pass.
- π¬π§United Kingdom catch
I appreciate the enthusiasm but all tests very much do not pass yet - removing the entry from system_schema() is finding bugs, thought this too easy when I pushed the initial changes.
- Status changed to Needs work
9 months ago 4:06pm 18 March 2024 - Status changed to Needs review
9 months ago 5:33pm 18 March 2024 - π¬π§United Kingdom catch
Test failures resolved I think:
1. The installer redirect trait hard-codes the {sessions} table, changed this to {sequences}. This will have to be tackled in π Stop installing system module before everything else Needs work so doesn't need its own follow-up.
2. SessionManager hard-codes a database query to the {sessions} table. Added a further try/catch there and opened π SessionManager should not directly query the sessions table Active .
- Status changed to RTBC
9 months ago 5:50pm 18 March 2024 - Status changed to Needs work
9 months ago 11:44am 20 March 2024 - π¬π§United Kingdom alexpott πͺπΊπ
Throwable is way more generic than the other instances of this in core... not sure if that matters but it feels odd. They all go for \Exception which is still super generic but less :). I think we should try to work on π Simplify exception handling for lazy-load pattern Needs work and try to standardise this in some way.
Left some other feedback on the MR.
- π¬π§United Kingdom catch
Yeah it didn't seem to hurt catching throwable in these cases because there's not really a lot else that can go wrong in the code path anyway, but also makes it a bit pointless - switched back to Exception everywhere and also applied the two suggestions.
Replied in the MR but we already have a follow-up which will handle the installer check it's just got slightly wider scope than just that check, but IMO between that issue and the eventual Drupal 12 issue to remove the sequences table it won't get forgotten.
- Status changed to Needs review
9 months ago 3:52pm 20 March 2024 - Status changed to RTBC
9 months ago 4:50pm 20 March 2024 - π¬π§United Kingdom catch
Only applying @alexpott's suggestions (either literal gitlab ones or review points), so moving back to RTBC.
- π¬π§United Kingdom alexpott πͺπΊπ
Committed and pushed da2e2ce2ae to 11.x and 9feabd3759 to 10.3.x. Thanks!
-
alexpott β
committed 9feabd37 on 10.3.x
Issue #3428565 by catch, phenaproxima, alexpott: Implement lazy database...
-
alexpott β
committed 9feabd37 on 10.3.x
- Status changed to Fixed
9 months ago 8:16am 21 March 2024 -
alexpott β
committed da2e2ce2 on 11.x
Issue #3428565 by catch, phenaproxima, alexpott: Implement lazy database...
-
alexpott β
committed da2e2ce2 on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.