-
-
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
Memcached meta-data error #16244
Comments
@quasipickle can you post the schema of your table including the index(es) ? Thanks |
I have three tables - I'm not sure which may be causing the issue. CREATE TABLE `album` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL COLLATE 'utf8mb4_unicode_520_ci',
`album_id` INT(11) UNSIGNED NULL DEFAULT NULL,
`photo_id` INT(11) UNSIGNED NULL DEFAULT NULL COMMENT 'The ID of the featured photo',
PRIMARY KEY (`id`) USING BTREE,
INDEX `index_foreignkey_album_album` (`album_id`) USING BTREE,
INDEX `album_ibfk_2` (`photo_id`) USING BTREE,
CONSTRAINT `album_ibfk_1` FOREIGN KEY (`album_id`) REFERENCES `album` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT `album_ibfk_2` FOREIGN KEY (`photo_id`) REFERENCES `photo` (`id`) ON UPDATE CASCADE ON DELETE SET NULL
)
COLLATE='utf8mb4_unicode_520_ci'
ENGINE=InnoDB
AUTO_INCREMENT=932
; CREATE TABLE `album_photo` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`photo_id` INT(11) UNSIGNED NULL DEFAULT NULL,
`album_id` INT(11) UNSIGNED NULL DEFAULT NULL,
`position` INT(10) UNSIGNED NOT NULL DEFAULT '999999999',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `UQ_cadf1c545153612614511f15197cae7b6dacac97` (`album_id`, `photo_id`) USING BTREE,
INDEX `index_foreignkey_album_photo_photo` (`photo_id`) USING BTREE,
INDEX `index_foreignkey_album_photo_album` (`album_id`) USING BTREE,
CONSTRAINT `c_fk_album_photo_album_id` FOREIGN KEY (`album_id`) REFERENCES `album` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT `c_fk_album_photo_photo_id` FOREIGN KEY (`photo_id`) REFERENCES `photo` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='utf8mb4_unicode_520_ci'
ENGINE=InnoDB
AUTO_INCREMENT=19529
; CREATE TABLE `photo` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`date_uploaded` DATETIME NOT NULL DEFAULT current_timestamp(),
`original_filename` TEXT NOT NULL COLLATE 'utf8mb4_unicode_520_ci',
`path` TEXT NOT NULL COLLATE 'utf8mb4_unicode_520_ci',
`width` SMALLINT(11) UNSIGNED NOT NULL,
`height` SMALLINT(11) UNSIGNED NOT NULL,
`thumb_path` TEXT NOT NULL COLLATE 'utf8mb4_unicode_520_ci',
`thumb_width` SMALLINT(5) UNSIGNED NOT NULL,
`thumb_height` SMALLINT(5) UNSIGNED NOT NULL,
`display_path` TEXT NOT NULL COLLATE 'utf8mb4_unicode_520_ci',
`display_width` SMALLINT(5) UNSIGNED NOT NULL,
`display_height` SMALLINT(5) UNSIGNED NOT NULL,
`mime_type` VARCHAR(255) NOT NULL COLLATE 'utf8mb4_unicode_520_ci',
`filesize` INT(11) UNSIGNED NULL DEFAULT NULL COMMENT 'In bytes',
`phash` BIGINT(255) UNSIGNED NOT NULL,
`battles` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`wins` INT(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_unicode_520_ci'
ENGINE=InnoDB
AUTO_INCREMENT=16978
; |
Hello! Using Redis, I ran into the same error SELECT IFNULL(SUM(valueInt), 0) AS [valueInt]
FROM [Models\Summary]
WHERE ((summaryTypeId = :summaryTypeId:)
AND (checkId IN({checkIds:array})))
AND (Models\Summary.entityId = 12) PHP: 8.1.16 |
@niden I have a similar problem
php 8.1 |
@niden Faced the same problem. :( php 8.2
|
any news? |
All I found is that at some point the model classes cache data and cannot access it. As an assumption, these are the moments when the cache is rotten at the time of the model's work (model works with meta always) gets null, falls, and then updates the cache in the database with the next iteration. But there are no 100% confirmations, just guesses. |
Sadly I have not been able to reproduce this. I have added the models that @quasipickle provided and wrote the relevant test for both Redis and Memcached. The test passes just fine and no issues reported on screen. Perhaps @Drummi42 is on to something but even when playing with the cache timeout I was unable to reproduce it. I am going to mark this as unverified and close it after the PR is merged. At least we gained two more tests. |
#16369 - Closing |
Discussed in #16225
Originally posted by quasipickle November 24, 2022
I'm not sure if this is a bug or misconfiguration - I'll re-post as a bug if necessary.
I'm trying to set up a
memcached
cache for my model meta-data. When I do so, I get this notice:And a thrown exception saying
The meta-data is invalid or is corrupt
fromphalcon/Mvc/Model/MetaData.zep:415
My cache service is set up like this:
The only thing I have in my models'
initialize()
is setting up relationships.System:
PHP: 8.1.12
Ubuntu: 20.04 (in WSL2 in Windows 10)
Phalcon: 5.1.1
Have I misconfigured something or is this a bug?
The text was updated successfully, but these errors were encountered: