Skip to content

Sessions transfer #5229

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

Merged
merged 41 commits into from
Apr 16, 2025
Merged

Sessions transfer #5229

merged 41 commits into from
Apr 16, 2025

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Mar 22, 2025

Attempt at transferring in-memory sessions across deployments using shared persistent cache and Unix domain sockets.

@ruslandoga ruslandoga changed the title sessions transfer Sessions transfer (PoC 1) Mar 22, 2025
@ruslandoga ruslandoga changed the title Sessions transfer (PoC 1) Sessions transfer Mar 22, 2025
@ruslandoga ruslandoga force-pushed the sessions-transfer branch 6 times, most recently from 17a0173 to 96d1b27 Compare March 23, 2025 09:40
@ruslandoga ruslandoga requested a review from Copilot March 28, 2025 17:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (4)
  • lib/plausible/application.ex: Language not supported
  • lib/plausible/session/persistence.ex: Language not supported
  • lib/plausible/session/persistence/tinysock.ex: Language not supported
  • lib/plausible_web/controllers/api/system_controller.ex: Language not supported

@ruslandoga ruslandoga force-pushed the sessions-transfer branch 8 times, most recently from 6ddc0b7 to e54aff6 Compare April 1, 2025 19:45
@ruslandoga ruslandoga marked this pull request as ready for review April 2, 2025 06:34
@ruslandoga ruslandoga requested review from aerosol and cnkk April 2, 2025 06:34
Copy link

github-actions bot commented Apr 7, 2025

Preview environment👷🏼‍♀️🏗️
PR-5229

@aerosol aerosol added preview and removed preview labels Apr 7, 2025
Copy link

github-actions bot commented Apr 7, 2025

Preview environment👷🏼‍♀️🏗️
PR-5229

defp file_stat_ctime(path) do
case File.stat(path) do
{:ok, stat} -> stat.ctime
{:error, _} -> nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What category of errors result with nil here? Shouldn't we then filter the path out and log failure?

Copy link
Contributor Author

@ruslandoga ruslandoga Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought about it much, but the idea was to allow tinysock client to remove stale/broken files in sock_connect_or_rm and since tuple (normal stat.ctime) is > nil, this ordering is like "asc nulls last" so the cleanup happens in the end of the transfer.

@@ -0,0 +1,31 @@
defmodule Plausible.Session.Transfer.Alive do
@moduledoc false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be beneficial to keep the docs.

Copy link
Contributor Author

@ruslandoga ruslandoga Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to have only one place with the docs, Plausible.Session.Transfer.
It already briefly explains the role of this "alive" process.

@aerosol aerosol enabled auto-merge April 16, 2025 09:56
@aerosol aerosol added this pull request to the merge queue Apr 16, 2025
Merged via the queue into master with commit 9bfb199 Apr 16, 2025
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants