Just a suggestion, at the moment, but definitely worth discussing in my opinion:

D7 shows that keeping the backend's table information in the server configuration leads to various problems, especially combined with Features, and in D8 where "configuration" is actually a concept, not just a name, this is bound to get even worth.

I think (and I'm very open to input here) that the conceptually proper way to store this information would be in the new State system. If implemented properly, I think it would ensure that moving configuration between servers works properly, with tables correctly created/changed/dropped according to changed configuration, etc.

Implementation-wise I imagine we'd have to store in the state the "revision" to which the current database layout for an index conforms, to detect when a change needs to occur. (As the "revision" here, I'd be thinking about an MD5 hash of the fields information, or something like that.) But maybe it would be possible without that, too, just moving the data more or less verbatim from the server/backend configuration to the State system.

Comments

drunken monkey created an issue. See original summary.

mollux’s picture

Assigned: Unassigned » mollux
Status: Active » Needs review
StatusFileSize
new18.82 KB

Makes sense to me to move that info to the state system. I don't think a md5 hash is needed, as the index name is unique.

The attached patch moves the info to the state system. Note that this will break existing sites, as there will be no info for the indexes for the database back-end anymore.

Status: Needs review » Needs work

mollux’s picture

StatusFileSize
new21.53 KB

Forgot to remove the config from the defaults db, should be fixed now.

mollux’s picture

Status: Needs work » Needs review
drunken monkey’s picture

StatusFileSize
new24.65 KB
new15.9 KB

Thanks, great work!
Just a bit of refactoring to make the code look nicer, and the small fix (plus test) we discussed.
If the test bot is OK with this and you're fine with it, too, then this would be RTBC in my opinion.

Status: Needs review » Needs work

The last submitted patch, 7: 2564847-7--db_info_to_site_state.patch, failed testing.

drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new25.28 KB
new4.99 KB

Apparently, subkey-access for site state isn't a thing.

Status: Needs review » Needs work

The last submitted patch, 9: 2564847-9--db_info_to_site_state.patch, failed testing.

The last submitted patch, 9: 2564847-9--db_info_to_site_state.patch, failed testing.

The last submitted patch, 7: 2564847-7--db_info_to_site_state.patch, failed testing.

drunken monkey’s picture

Assigned: mollux » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new25.47 KB
new1.05 KB
new36.94 KB

Status: Needs review » Needs work

The last submitted patch, 13: 2564847-11--db_info_to_site_state.patch, failed testing.

The last submitted patch, 13: 2564847-11--db_info_to_site_state.patch, failed testing.

drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new25.46 KB
new847 bytes

Status: Needs review » Needs work

The last submitted patch, 16: 2564847-16--db_info_to_site_state.patch, failed testing.

The last submitted patch, 16: 2564847-16--db_info_to_site_state.patch, failed testing.

The last submitted patch, 16: 2564847-16--db_info_to_site_state.patch, failed testing.

mollux’s picture

Status: Needs work » Needs review
StatusFileSize
new25.47 KB

Probably fixed the failing tests

drunken monkey’s picture

StatusFileSize
new17.57 KB
new10.71 KB

Sorry, wrong issue!

drunken monkey’s picture

drunken monkey’s picture

Status: Needs review » Needs work

As discussed, thanks a lot for finding this problem!

I also finally found Sascha (or, rather, he found me) and he also thinks this would be a great move.
However, I asked him about putting so much data into the site state, and he told me they'd probably add caching for it at some point so it would actually be better not to use the site state, but our own, separate key-value store directly. It's supposed to work almost the same, the state just provides a slightly simplified API to access key-value store functionality.

So one of us should probably re-write this to use that instead. Hopefully, it will just be straight-forward changes that won't break anything again.
Do you still have time to work on this, Mattias, or would you prefer if I took over? (Sorry I didn't ask Sascha earlier!)

drunken monkey’s picture

Assigned: Unassigned » drunken monkey
drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new27.44 KB
new20.81 KB

Implemented the switch. Let's hope for the best …

drunken monkey’s picture

StatusFileSize
new31.68 KB

Re-roll for latest commits, testing again just to make sure …

The last submitted patch, 26: 2564847-26--db_info_to_site_state.patch, failed testing.

  • drunken monkey committed 1458725 on 8.x-1.x authored by mollux
    Issue #2564847 by mollux, drunken monkey: Moved information about the...
drunken monkey’s picture

Status: Needs review » Fixed

Ah, great, finally!
Committed.
Thanks again a lot for your work, Mattias!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.