Expect `noart` in production mode

This might make one think that we are being outrageously strict,
but at the end of the day, it can help investigate crashes
or inspect logs without artwork all over the place.

Following some discussions, the `user` mode was renamed to `dev`
mode.

This commit also upgrades some deps, other than clap which has
deprecated yaml support (we will continue to use 2.x).

Finally, the CHANGELOG was updated.
next
Sayan Nandan 3 years ago
parent 46c048f855
commit d550e0d7a7
No known key found for this signature in database
GPG Key ID: 8BC07A0A4D41DD52

@ -10,6 +10,7 @@ All changes in this project will be noted in this file.
### Additions
- Added `dev/prod` mode for making sure that the recommended production settings are used
- Added support for system native endian storage (backward compatible)
## Version 0.7.2

106
Cargo.lock generated

@ -181,7 +181,7 @@ dependencies = [
"crossterm_winapi",
"libc",
"mio",
"parking_lot",
"parking_lot 0.11.2",
"signal-hook",
"signal-hook-mio",
"winapi",
@ -287,7 +287,7 @@ checksum = "fcef756dea9cf3db5ce73759cf0467330427a786b47711b8d6c97620d718ceb9"
dependencies = [
"cfg-if",
"rustix",
"windows-sys",
"windows-sys 0.30.0",
]
[[package]]
@ -423,9 +423,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.113"
version = "0.2.116"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9"
checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74"
[[package]]
name = "libsky"
@ -453,9 +453,9 @@ checksum = "95f5690fef754d905294c56f7ac815836f2513af966aa47f2e07ac79be07827f"
[[package]]
name = "lock_api"
version = "0.4.5"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
dependencies = [
"scopeguard",
]
@ -617,7 +617,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
dependencies = [
"instant",
"lock_api",
"parking_lot_core",
"parking_lot_core 0.8.5",
]
[[package]]
name = "parking_lot"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
dependencies = [
"lock_api",
"parking_lot_core 0.9.0",
]
[[package]]
@ -634,6 +644,19 @@ dependencies = [
"winapi",
]
[[package]]
name = "parking_lot_core"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2f4f894f3865f6c0e02810fc597300f34dc2510f66400da262d8ae10e75767d"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-sys 0.29.0",
]
[[package]]
name = "pin-project-lite"
version = "0.2.8"
@ -839,18 +862,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "serde"
version = "1.0.135"
version = "1.0.136"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cf9235533494ea2ddcdb794665461814781c53f19d87b76e571a1c35acbad2b"
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.135"
version = "1.0.136"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dcde03d87d4c973c04be249e7d8f0b35db1c848c487bd43032808e59dd8328d"
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
dependencies = [
"proc-macro2",
"quote",
@ -951,7 +974,7 @@ dependencies = [
"log",
"num_cpus",
"openssl",
"parking_lot",
"parking_lot 0.12.0",
"rand",
"regex",
"serde",
@ -1081,9 +1104,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.15.0"
version = "1.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838"
checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a"
dependencies = [
"bytes",
"libc",
@ -1091,7 +1114,7 @@ dependencies = [
"mio",
"num_cpus",
"once_cell",
"parking_lot",
"parking_lot 0.11.2",
"pin-project-lite",
"signal-hook-registry",
"tokio-macros",
@ -1209,43 +1232,86 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ceb069ac8b2117d36924190469735767f0990833935ab430155e71a44bafe148"
dependencies = [
"windows_aarch64_msvc 0.29.0",
"windows_i686_gnu 0.29.0",
"windows_i686_msvc 0.29.0",
"windows_x86_64_gnu 0.29.0",
"windows_x86_64_msvc 0.29.0",
]
[[package]]
name = "windows-sys"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "030b7ff91626e57a05ca64a07c481973cbb2db774e4852c9c7ca342408c6a99a"
dependencies = [
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_msvc",
"windows_aarch64_msvc 0.30.0",
"windows_i686_gnu 0.30.0",
"windows_i686_msvc 0.30.0",
"windows_x86_64_gnu 0.30.0",
"windows_x86_64_msvc 0.30.0",
]
[[package]]
name = "windows_aarch64_msvc"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b"
[[package]]
name = "windows_aarch64_msvc"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca"
[[package]]
name = "windows_i686_gnu"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58"
[[package]]
name = "windows_i686_gnu"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8"
[[package]]
name = "windows_i686_msvc"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4"
[[package]]
name = "windows_i686_msvc"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6"
[[package]]
name = "windows_x86_64_gnu"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354"
[[package]]
name = "windows_x86_64_gnu"
version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a"
[[package]]
name = "windows_x86_64_msvc"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561"
[[package]]
name = "windows_x86_64_msvc"
version = "0.30.0"

@ -14,7 +14,7 @@ skytable = { git = "https://github.com/skytable/client-rust", branch = "next", f
"aio-sslv",
], default-features = false }
# external deps
tokio = { version = "1.15.0", features = ["full"] }
clap = { version = "2.34.0", features = ["yaml"] }
tokio = { version = "1.16.1", features = ["full"] }
clap = { version = "2", features = ["yaml"] }
rustyline = "9.1.2"
crossterm = "0.22.1"

@ -11,6 +11,7 @@ host = "127.0.0.1" # The IP address to which you want sdb to bind to
port = 2003 # The port to which you want sdb to bind to
noart = false # Set `noart` to true if you want to disable terminal artwork
maxcon = 50000 # set the maximum number of clients that the server can accept
mode = "dev" # Set this to `prod` when you're running in production and `dev` when in development
# This key is *OPTIONAL*
[bgsave]

@ -14,16 +14,16 @@ skytable = { git = "https://github.com/skytable/client-rust", branch = "next", d
ahash = "0.7.6"
bytes = "1.1.0"
chrono = "0.4.19"
clap = { version = "2.34.0", features = ["yaml"] }
clap = { version = "2", features = ["yaml"] }
env_logger = "0.9.0"
hashbrown = { version = "0.12.0", features = ["raw"] }
log = "0.4.14"
num_cpus = "1.13.1"
openssl = { version = "0.10.38", features = ["vendored"] }
parking_lot = "0.11.2"
parking_lot = "0.12.0"
regex = "1.5.4"
serde = { version = "1.0.135", features = ["derive"] }
tokio = { version = "1.15.0", features = ["full"] }
serde = { version = "1.0.136", features = ["derive"] }
tokio = { version = "1.16.1", features = ["full"] }
tokio-openssl = "0.6.3"
toml = "0.5.8"
@ -48,10 +48,10 @@ skytable = { git = "https://github.com/skytable/client-rust", features = [
# external deps
bincode = "1.3.3"
rand = "0.8.4"
tokio = { version = "1.15.0", features = ["test-util"] }
tokio = { version = "1.16.1", features = ["test-util"] }
[target.'cfg(unix)'.dependencies]
# external deps
libc = "0.2.113"
libc = "0.2.116"
[features]
nightly = []

@ -118,7 +118,7 @@ impl ConfigurationSet {
SnapshotConfig::default(),
PortConfig::new_insecure_only(DEFAULT_IPV4, 2003),
MAXIMUM_CONNECTION_LIMIT,
Modeset::User,
Modeset::Dev,
)
}
/// Returns `false` if `noart` is enabled. Otherwise it returns `true`
@ -334,7 +334,7 @@ impl ConfigType {
#[derive(Debug, PartialEq)]
pub enum Modeset {
User,
Dev,
Prod,
}
@ -342,7 +342,7 @@ impl FromStr for Modeset {
type Err = ();
fn from_str(st: &str) -> Result<Modeset, Self::Err> {
match st {
"user" => Ok(Modeset::User),
"dev" => Ok(Modeset::Dev),
"prod" => Ok(Modeset::Prod),
_ => Err(()),
}
@ -361,7 +361,7 @@ impl<'de> Visitor<'de> for ModesetVisitor {
E: de::Error,
{
match value {
"user" => Ok(Modeset::User),
"dev" => Ok(Modeset::Dev),
"prod" => Ok(Modeset::Prod),
_ => return Err(E::custom(format!("Bad value `{value}` for modeset"))),
}

@ -229,6 +229,10 @@ fn check_rlimit_or_err(_: usize, _: &mut ErrorStack) -> Result<(), ConfigError>
/// Check if the settings are suitable for use in production mode
pub(super) fn evaluate_prod_settings(cfg: &ConfigurationSet) -> Result<(), ConfigError> {
let mut estack = ErrorStack::new(EMSG_PROD);
// check `noart`
if cfg.is_artful() {
estack.push("Terminal artwork should be disabled");
}
// first check BGSAVE
if cfg.bgsave.is_disabled() {
estack.push("BGSAVE must be enabled");

@ -383,7 +383,7 @@ impl Configset {
self.cfg.maxcon = maxcon;
}
pub fn server_mode(&mut self, nmode: impl TryFromConfigSource<Modeset>, nmode_key: StaticStr) {
let mut modeset = Modeset::User;
let mut modeset = Modeset::Dev;
self.try_mutate(
nmode,
&mut modeset,

@ -403,7 +403,7 @@ mod cfg_file_tests {
snapshot: SnapshotConfig::default(),
ports: PortConfig::default(),
maxcon: MAXIMUM_CONNECTION_LIMIT,
mode: Modeset::User
mode: Modeset::Dev
}
);
}
@ -423,7 +423,7 @@ mod cfg_file_tests {
DEFAULT_PORT
),
maxcon: MAXIMUM_CONNECTION_LIMIT,
mode: Modeset::User
mode: Modeset::Dev
}
);
}
@ -448,7 +448,7 @@ mod cfg_file_tests {
)
),
MAXIMUM_CONNECTION_LIMIT,
Modeset::User,
Modeset::Dev,
)
);
}
@ -472,7 +472,7 @@ mod cfg_file_tests {
snapshot: SnapshotConfig::default(),
ports: PortConfig::default(),
maxcon: MAXIMUM_CONNECTION_LIMIT,
mode: Modeset::User
mode: Modeset::Dev
}
);
}
@ -493,7 +493,7 @@ mod cfg_file_tests {
snapshot: SnapshotConfig::default(),
ports: PortConfig::default(),
maxcon: MAXIMUM_CONNECTION_LIMIT,
mode: Modeset::User
mode: Modeset::Dev
}
)
}
@ -514,7 +514,7 @@ mod cfg_file_tests {
snapshot: SnapshotConfig::default(),
ports: PortConfig::default(),
maxcon: MAXIMUM_CONNECTION_LIMIT,
mode: Modeset::User
mode: Modeset::Dev
}
)
}
@ -531,7 +531,7 @@ mod cfg_file_tests {
noart: false,
ports: PortConfig::default(),
maxcon: MAXIMUM_CONNECTION_LIMIT,
mode: Modeset::User
mode: Modeset::Dev
}
);
}
@ -808,9 +808,9 @@ mod modeset_de {
#[test]
fn deserialize_modeset_user_okay() {
let toml = r#"mode="user""#;
let toml = r#"mode="dev""#;
let x: Example = toml::from_str(toml).unwrap();
assert_eq!(x.mode, Modeset::User);
assert_eq!(x.mode, Modeset::Dev);
}
#[test]

@ -11,8 +11,8 @@ version = "0.7.2"
libstress = { path = "../libstress" }
skytable = { git = "https://github.com/skytable/client-rust", branch = "next" }
# external deps
clap = { version = "2.34.0", features = ["yaml"] }
clap = { version = "2", features = ["yaml"] }
devtimer = "4.0.1"
rand = "0.8.4"
serde = { version = "1.0.135", features = ["derive"] }
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.78"

@ -11,4 +11,4 @@ skytable = { git = "https://github.com/skytable/client-rust.git" }
env_logger = "0.9.0"
bincode = "1.3.3"
log = "0.4.14"
clap = { version = "2.34.0", features = ["yaml"] }
clap = { version = "2", features = ["yaml"] }

Loading…
Cancel
Save