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

Implement WAL writer for the net log writer #5697

Open
mohammed90 opened this issue Aug 5, 2023 · 0 comments
Open

Implement WAL writer for the net log writer #5697

mohammed90 opened this issue Aug 5, 2023 · 0 comments
Labels
feature ⚙️ New feature or request help wanted 🆘 Extra attention is needed
Milestone

Comments

@mohammed90
Copy link
Member

mohammed90 commented Aug 5, 2023

The net log writer is great for infrastructure where logs across all systems sink into a centralized system. However, the current implementation is bitten by the following fallacies of distributed systems1:

  • The network is reliable
  • Latency is zero
  • Bandwidth is infinite
  • Transport cost is zero

We've heard at least 1 report of pain when the network misbehaves, #4083. While timeouts and redialing resolved the earlier issue, it isn't robust against the relevant fallacies. We can still suffer from slowness. We're still reliant on the network's bandwidth. The network misbehavior can impact Caddy's performance.

To get around the fallacies and not impact Caddy's performance, I propose we introduce WAL to the net writer. The WAL will be placed in the data directory. Log writes are synchronously written to the WAL, and an asynchronous reader (from WAL) picks up the entries to write them to the network. On first open, the net writer opens the standard WAL, and it should check for unwritten entries to be synchronized to upstream. On close, the writer should attempt to flush/drain all the entries in the WAL.

With this implementation, Caddy will not suffer due to external network issues pertaining to the log sink, e.g. network is slow, log ingester is slow, or any of the fallacies.

Have I missed anything?

Footnotes

  1. Fallacies of Distributed Systems

@mohammed90 mohammed90 added the feature ⚙️ New feature or request label Aug 5, 2023
@mohammed90 mohammed90 added this to the 2.x milestone Aug 5, 2023
@mohammed90 mohammed90 added the help wanted 🆘 Extra attention is needed label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ⚙️ New feature or request help wanted 🆘 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant