Skip to content
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

Add support for Magento compressed session data #5028

Closed
kanevbg opened this issue Apr 6, 2021 · 16 comments
Closed

Add support for Magento compressed session data #5028

kanevbg opened this issue Apr 6, 2021 · 16 comments

Comments

@kanevbg
Copy link

kanevbg commented Apr 6, 2021

I'm always frustrated when I had to inspect data in redis, stored by Magento 1/2 system, as it is using compression and the data is not readable straight-away when inspecting.

I'd like to have a "View as" option which support decompression.
The type of compression used by default in Magento is gzip, however there is option and implementation for snappy, lzf and lz4. If all of these can be supported it will be even better.

@uglide
Copy link
Collaborator

uglide commented Apr 6, 2021

Hello @kanevbg
RDM currently supports automatic decompression of GZIP and LZ4 by finding corresponding "magic" header https://github.com/uglide/RedisDesktopManager/blob/2021/src/app/qcompress.cpp#L16

Could you provide sample of the data created by Magento? It will help to figure out why it's not decompressed automatically in RDM. Thanks!

@kanevbg
Copy link
Author

kanevbg commented Apr 6, 2021

sample-hex.txt
here it is, viewed as hex

@kanevbg
Copy link
Author

kanevbg commented Apr 20, 2021

Is it reproducible?

@uglide
Copy link
Collaborator

uglide commented Apr 21, 2021

@kanevbg sorry for the late reply. Build-in decompression doesn't work due to gz: prefix in your value.
I'm trying to setup test Magento environment to play with all kind of cache compression types and get all possible combinations of values to add proper support for it in RDM.

@uglide uglide changed the title "View as" option to support decompression Add support for Magento compressed session data Nov 17, 2021
uglide added a commit that referenced this issue Nov 18, 2021
@uglide
Copy link
Collaborator

uglide commented Nov 18, 2021

@kanevbg Could you please specify which platform/OS do you use?

I've added support for Magento compression/decompression for gzip and lz4 in #5130 and will be grateful if you could try preview build with these changes.

@kanevbg
Copy link
Author

kanevbg commented Nov 18, 2021

I will do. Using on windows 10 Pro 21H1 x64. Will be great if you add support for zstd too, I can test that too.

@uglide
Copy link
Collaborator

uglide commented Nov 18, 2021

Yes, general zstd support will be also included. But I don't see zstd in Magento settings here https://devdocs.magento.com/guides/v2.4/config-guide/redis/redis-session.html :)

@kanevbg
Copy link
Author

kanevbg commented Nov 18, 2021

Its not documented but is available trough the actual adapter magento used: \Cm_Cache_Backend_Redis
Use like this
image
php zstd extension is required too.

@uglide
Copy link
Collaborator

uglide commented Nov 18, 2021

@kanevbg thanks for the hint. Will try it out.

uglide added a commit that referenced this issue Nov 19, 2021
uglide added a commit that referenced this issue Nov 19, 2021
uglide added a commit that referenced this issue Nov 19, 2021
@uglide
Copy link
Collaborator

uglide commented Nov 19, 2021

@kanevbg Please sign in with your account on rdm.dev and go to https://rdm.dev/subscriptions
In the "Preview Builds" tab you can download rdm-2021.9.384.exe which includes Magento automatic decompression for cache and sessions.

Please share your feedback. Thanks!

@kanevbg
Copy link
Author

kanevbg commented Nov 19, 2021

image
seems fine
however FPC html data is not readable
image
EDIT: the data is readable only the first time data of key is decoded, every other time fails until key reload

EDIT 2: and here the data is always undecoded:
image

@uglide
Copy link
Collaborator

uglide commented Nov 19, 2021

@kanevbg thanks. will double-check

@kanevbg
Copy link
Author

kanevbg commented Nov 19, 2021

In order to reproduce test will cache entries which has more than one keys which should be decoded. In the above case t & d are both to be decoded

@uglide
Copy link
Collaborator

uglide commented Nov 19, 2021

@kanevbg added fix in rdm-2021.9.385.exe

@uglide
Copy link
Collaborator

uglide commented Nov 22, 2021

@kanevbg Please let me know if you have any other feedback or faced any other issues. Thanks!

@kanevbg
Copy link
Author

kanevbg commented Nov 22, 2021

In this field the issue is not solved, other cases are fixed.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants