Skip to content

Commit

Permalink
chore(su): clean su data storage code
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceJuliano committed Jul 1, 2024
1 parent 19dc28f commit f163e21
Show file tree
Hide file tree
Showing 10 changed files with 452 additions and 425 deletions.
87 changes: 9 additions & 78 deletions servers/su/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion servers/su/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dashmap = "5.5.3"
base64 = "0.21.5"
actix-cors = "0.6.0"
simd-json = "0.13.10"
indicatif = "0.17.8"
futures = "0.3.30"
rocksdb = "0.22.0"

Expand Down
13 changes: 11 additions & 2 deletions servers/su/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ Create a .env file with the following variables, or set them in the OS:
- `UPLOAD_NODE_URL` an uploader url such as `https://up.arweave.net`
- `MODE` can be either value `su` or `router` but for local development use `su`
- `SCHEDULER_LIST_PATH` a list of schedulers only used for `router` MODE. Ignore when in `su` MODE, just set it to `""`.
- `DB_WRITE_CONNECTIONS` how many db connections in the writer pool,defaults to 10
- `DB_READ_CONNECTIONS` how many db connections in the reader pool, default to 10
- `USE_DISK` whether or not to write and read rocksdb, this is a performance enhancement for the data storage layer
- `SU_DATA_DIR` if `USE_DISK` is `true`, this is where rocksdb will be initialized
- `MIGRATION_BATCH_SIZE` when running the migration binary how many to fetch at once from postgres

> You can also use a `.env` file to set environment variables when running in
> development mode, See the `.env.example` for an example `.env`
Expand Down Expand Up @@ -106,8 +111,12 @@ in the container.
- `UPLOAD_NODE_URL` an uploader url such as `https://up.arweave.net`
- `MODE` can be either value `su` or `router` but for local development use `su`
- `SCHEDULER_LIST_PATH` a list of schedulers only used for `router` MODE. Ignore in `su` mode just set it to `""`.
- `USE_DISK` whether or not to read and write message files from/to the disk/rocksdb. If the su has already been running for a while the data will need to be migrated using the mig binary before turning this on. This enhances the performance if the data is properly migrated to using the migration binary first.
- `SU_DATA_DIR` The data directory on disk where the su will create a rocksdb key value store, it will only be used from if `USE_DISK` is `true`
- `DB_WRITE_CONNECTIONS` how many db connections in the writer pool,defaults to 10
- `DB_READ_CONNECTIONS` how many db connections in the reader pool, default to 10
- `USE_DISK` whether or not to write and read rocksdb, this is a performance enhancement for the data storage layer
- `SU_DATA_DIR` if `USE_DISK` is `true`, this is where rocksdb will be initialized
- `MIGRATION_BATCH_SIZE` when running the migration binary how many to fetch at once from postgres



### Running a router in front of multiple scheduler units
Expand Down
Binary file modified servers/su/mig
Binary file not shown.
2 changes: 0 additions & 2 deletions servers/su/src/bin/mig.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use std::io;

use su::domain::migrate_to_disk;
Expand All @@ -7,4 +6,3 @@ use su::domain::migrate_to_disk;
async fn main() -> io::Result<()> {
migrate_to_disk().await
}

Loading

0 comments on commit f163e21

Please sign in to comment.