We have a number of docs links in the product that point to the old doc site.
Method:
- Search the repo for `docs.sourcegraph.com`
- Exclude the `doc/` dir, all test fixtures, and `CHANGELOG.md`
- For each, replace `docs.sourcegraph.com` with `sourcegraph.com/docs`
- Navigate to the resulting URL ensuring it's not a dead link, updating the URL if necessary
Many of the URLs updated are just comments, but since I'm doing a manual audit of each URL anyways, I felt it was worth it to update these while I was at it.
Had to pin two dependencies.
github.com/golang/protobuf@v1.3.5 - It seems to be enforcing something
to do with resource names. This is causing our use of our k8s client to
panic.
github.com/aws/aws-sdk-go-v2@v0.20.0 - They removed some types in the
endpoint package we relied on. Unsure how to fix yet, so punting until
the next time someone tries to update dependencies.
* redis: Make redis-cache persistent again
This commit reverts the part of #8114 that made `redis-cache` not
persistent. Sourcegraph cannot work well with a cold cache, so we
need to persist this cached data to prevent cold starts (e.g. for
GitHub and GitLab cached user permissions).
* fixup! Improvements
* fixup! generate
* fixup! explicit appendonly no
* redis-pool: Use BGREWRITEAOF as sysreq command
This commit makes the sysreq check for redis store and cache run a
`BGREWRITEAOF` command rather than a simple `PING`. This ensures that
the AOF file doesn't grow unbounded due to frequent container restarts
(with the server image). The command itself is non-blocking and
best-effort.
The reason I didn't add this command to be ran from a Procline in the
server process manager is that it would require Redis to already by up,
and that would be substantially harder to wire together than this.
Fixes#3300
* server: Redis persistence optimizations
This commit optimizes how we do Redis persistence in the server image by:
1. Upgrading Redis to version 5.0.7 so that we can use the
`aof-use-rdb-preamble` setting which substantially speeds up the server
image start-up time in certain scenarios (see #3300).
2. Making `redis-cache` truly ephemeral by not storing any snapshots or
append only log to disk.
* doc: Update Redis version
* Update CHANGELOG
* server: Always rewrite redis config
* fixup! ./dev/generate
* Update CHANGELOG.md
Co-Authored-By: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
Co-authored-by: Keegan Carruthers-Smith <keegan.csmith@gmail.com>
Noticed a new release which deals with a staticcheck complaint. Luckily we are
not running into it (yet), but did the work to update anyways so lets ship this.
* Use 2 Redis instances in Server image, redis-cache & redis-store
This fixes#5015 by changing the Server image configuration to launch
two Redis instances, one to be used as a cache and one as a store.
The cache instance runs on port 6380 (unused according to [1])
and has `maxmemory-policy allkeys-lru`, which allows us to get rid of
TTLs on the cache keys (which I want to do as a separate follow-up PR).
After looking at the usage of Redis on my local Sourcegraph instance, I
decided to give the cache instance 800mb of memory and the store
instance 200mb (1GB was the maxmemory value used before). If someone has
better suggestions for this ratio, let me know.
I built and ran the server image locally and tested that both Redis
instances get used by `docker exec`ing into the Server image and running
`redis-cli -p <port> MONITOR` two times.
Let me know if there's anything I forgot or should add.
[1]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
* Give both Redis instances in server image 1GB of memory
* Increase rcache.dataVersion to allow Redis migration in server image
* Use old data dir for redis-store instance to migrate data
* Add Redis migration to server to delete old rcache keys
* Retry connecting to Redis in Server
* Simplify handling Redis migration
* Turn deleting old cache data in Redis into generic migration
* Add a warning message to check Redis cache eviction policy
* Move cleanup logic for old rcache data to rcache package
* Fix involuntarily changed maxmemory-policy
* Use lua script to delete old cache data in Redis
This is an issue we have encountered before were docker doesn't correctly
resolve localhost, but does resolve 127.0.0.1 correctly.
We also move this bit of config into the sourcegraph controlled config, since
this is already an example where we want to be able to mutate this config.
We currently generate the nginx.conf for users, but then it is controlled by
users. If we want to change a setting in nginx.conf (such as changing a proxy
timeout), we then have to rely on user instructions to update the config.
Instead we can hook into the config via well placed include directives.