diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-08-27 18:59:09 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-10-24 11:15:51 +0200 |
commit | d8515c8d359e92dfc1748df87b98a431e2c1d76f (patch) | |
tree | bb182a815f14840cc838e2c4b1a9ebee8d39c1b0 /storage/maria | |
parent | e764d11829436321dec08c84251cb28cbae8511c (diff) | |
download | mariadb-git-d8515c8d359e92dfc1748df87b98a431e2c1d76f.tar.gz |
S3 plugin fails to load depending on loaded storage engines
storage engines are generally initialized in some random order
(by iterating the hash of plugin names).
S3 fails if it's initialized before Aria.
But it looks that while S3 needs Aria, it does not need
Aria to be initialized before S3. S3 copies maria_hton and then
overwrites every single member of it, so it can handle Aria being
initialized after S3.
Diffstat (limited to 'storage/maria')
-rw-r--r-- | storage/maria/ha_maria.cc | 2 | ||||
-rw-r--r-- | storage/maria/ha_s3.cc | 13 |
2 files changed, 6 insertions, 9 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 5f195a9eb8e..26066135b2c 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -72,7 +72,7 @@ const char *zerofill_error_msg= corrupted. */ ulonglong maria_recover_options= HA_RECOVER_NONE; -handlerton __attribute__((visibility("default"))) *maria_hton; +handlerton *maria_hton; /* bits in maria_recover_options */ const char *maria_recover_names[]= diff --git a/storage/maria/ha_s3.cc b/storage/maria/ha_s3.cc index e9396329c50..cf2b9098142 100644 --- a/storage/maria/ha_s3.cc +++ b/storage/maria/ha_s3.cc @@ -51,7 +51,11 @@ but the stored block will be the size of the compressed block. Implementation: - The s3 engine inherits from the ha_maria handler + The s3 engine inherits from the ha_maria handler. + + It uses Aria code and relies on Aria being enabled. We don't have to check + that Aria is enabled though, because Aria is a mandatory plugin, and + the server will refuse to start if Aria failed to initialize. s3 will use it's own page cache to not interfere with normal Aria usage but also to ensure that the S3 page cache is large enough @@ -996,14 +1000,7 @@ static int ha_s3_init(void *p) bool res; static const char *no_exts[]= { 0 }; - /* This can happen if Aria fails to start */ - if (!maria_hton) - return HA_ERR_INITIALIZATION; - s3_hton= (handlerton *)p; - - /* Use Aria engine as a base */ - memcpy(s3_hton, maria_hton, sizeof(*s3_hton)); s3_hton->db_type= DB_TYPE_S3; s3_hton->create= s3_create_handler; s3_hton->panic= s3_hton_panic; |