Skip to content

Commit

Permalink
Merge pull request #124 from martin-belanger/not-sticky
Browse files Browse the repository at this point in the history
Make sticky-connection=disabled by default
  • Loading branch information
martin-belanger authored May 19, 2022
2 parents da3ff1c + 97339ad commit 6136062
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ test: stas

.PHONY: loc
loc:
@cloc --by-file --exclude-dir=${BUILD-DIR},doc,test,utils,debian,obj-x86_64-linux-gnu,.github --exclude-lang=Markdown,"NAnt script",XML,"Bourne Again Shell",make,"Bourne Shell",Meson,YAML,XSLT .
@cloc --by-file --exclude-dir=${BUILD-DIR},doc,subprojects,test,utils,debian,obj-x86_64-linux-gnu,.github --exclude-lang=Markdown,"NAnt script",XML,"Bourne Again Shell",make,"Bourne Shell",Meson,YAML,XSLT .

.PHONY: loc-full
loc-full:
@cloc --by-file --exclude-dir=${BUILD-DIR},doc,test,utils,debian,obj-x86_64-linux-gnu,.github .
@cloc --by-file --exclude-dir=${BUILD-DIR},doc,subprojects,test,utils,debian,obj-x86_64-linux-gnu,.github .

# Coverage requirements:
# pip install coverage
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# STorage Appliance Services (STAS)

## Changes with release 1.1.1

Make `sticky-connections-disabled`

by default

## Changes with release 1.1

- Add `udev-rule` configuration parameter to `stacd.conf`.
Expand Down
2 changes: 1 addition & 1 deletion coverage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ cat > "${stacd_conf_fname}" <<'EOF'
tron=true
kato=10
udev-rule=disabled
sticky-connections=disabled
sticky-connections=enabled
EOF

sudo systemctl stop avahi-daemon.service
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author = 'Martin Belanger <[email protected]>'
master_doc = 'index'

release = '1.1'
release = '1.1.1'


# -- General configuration ---------------------------------------------------
Expand Down
27 changes: 13 additions & 14 deletions doc/man/stacd.conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,30 +265,29 @@
</para>

<para>
Note that <code>nvme-stas</code> was modeled after
<code>nvme-cli</code>. <code>nvme-cli</code> maintains
I/O controller connections by default (i.e. connections
are sticky). That's why <code>nvme-stas</code> also
maintains I/O controller connections by default.
With <code>sticky-connections=disabled</code>, the default,
<code>stacd</code> immediately disconnects from
a previously connected I/O controller if the response
to a Get DLP command no longer contains a DLPE
matching that I/O controller. Ongoing I/O transactions
will be terminated immediately as well. There is no
way to tell what happens to the data being exchanged
when such an abrupt termination happens. If a host
was in the middle of writing to a storage subsystem,
there is a good chance that incomplete and
potentially corrupt data will be left on the remote
storage.
</para>

<para>
With <code>sticky-connections=enabled</code>, the default,
With <code>sticky-connections=enabled</code>,
<code>stacd</code> does not disconnect from I/O
controllers when a DPLE is removed. Instead, users
can issue the <code>nvme-cli</code> command
"<code>nvme disconnect</code>" to disconnect (or wait
until the next system reboot at which time all
connections will be removed).
</para>

<para>
With <code>sticky-connections=disabled</code>,
<code>stacd</code> immediately disconnects from
a previously connected I/O controller if the response
to a Get DLP command no longer contains a DLPE
matching that I/O controller.
</para>
</listitem>
</varlistentry>
</variablelist>
Expand Down
11 changes: 6 additions & 5 deletions etc/stas/stacd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,15 @@
# after their DPLEs have been removed or to immediately
# remove them.
#
# nvme-cli uses sticky connections by default. Since
# nvme-stas was modeled after nvme-cli, I/O connections
# will also be sticky by default.
# To be consistent with the standards, nvme-stas terminates
# I/O connections immediately on DLPE removal (connections
# are NOT sticky by default). This is the opposite of how
# nvme-cli operates.
#
# Type: String
# Range: [disabled, enabled]
# Default: enabled
#sticky-connections=enabled
# Default: disabled
#sticky-connections=disabled

[Controllers]
# controller: I/O Controllers (IOC) are specified with this keyword.
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project(
'nvme-stas',
meson_version: '>= 0.53.0',
version: '1.1',
version: '1.1.1',
license: 'Apache-2.0',
default_options: [
'buildtype=release',
Expand Down
2 changes: 1 addition & 1 deletion staslib/stas.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def __init__(self, conf_file='/dev/null'):
('Global', 'ignore-iface'): 'false',
('Global', 'ip-family'): 'ipv4+ipv6',
('Global', 'udev-rule'): 'enabled',
('Global', 'sticky-connections'): 'enabled',
('Global', 'sticky-connections'): 'disabled',
('Service Discovery', 'zeroconf'): 'enabled',
('Controllers', 'controller'): list(),
('Controllers', 'blacklist'): list(),
Expand Down
2 changes: 1 addition & 1 deletion test/test-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_config(self):
self.assertFalse(cnf.data_digest)
self.assertTrue(cnf.persistent_connections)
self.assertTrue(cnf.udev_rule_enabled)
self.assertTrue(cnf.sticky_connections)
self.assertFalse(cnf.sticky_connections)
self.assertFalse(cnf.ignore_iface)
self.assertIn(6, cnf.ip_family)
self.assertNotIn(4, cnf.ip_family)
Expand Down

0 comments on commit 6136062

Please sign in to comment.