Skip to content

Optimize keyword handling and driver manifest caching#989

Open
cvaroqui wants to merge 9 commits intoopensvc:mainfrom
cvaroqui:main
Open

Optimize keyword handling and driver manifest caching#989
cvaroqui wants to merge 9 commits intoopensvc:mainfrom
cvaroqui:main

Conversation

@cvaroqui
Copy link
Member

No description provided.

The keyword.Keyword struct is big and complex (contains list of
types, ...) so using the concrete type in func prototypes caused
lots of allocations and resulted in partial copies.

Use pointers to stop copying, as kw definition are immutable
anyway. Save cpu time.
* Cache the manifests to avoid rebuilding the kw lists
* Add a DriverID() driver.ID func to the resource.Driver intf
* Use DriverID() as the manifest cache key
* Use directly DriverID() instead of Manifest().DriverID() in
a lot of codepaths (lighter, lockless response)
Triggered by a corner case where topology is flex but
object.Status.Flex is nil.
Which blocked the CI on:

	Go build and test: drivers/resappforking/main_test.go#L242
	method T.DriverID already declared at drivers/resappforking/manifest.go:35:13
The "lxc info <name>" command exits when no error and empty
output when the container is down and defined.

The abort routine did not test the output length so reported
the container up on peer when actually not.
Encap nodes don't orchestrate ha start, so no need to freeze.
Actions with a --rid, --tag, --subset, --to resource selector
ended up with a wrong dispatch ... the encap node trying to
execute the action on a non-relevant rid.

Fix, no longer pass --rid, --tag, subset and --to unchanged to
the encap node, but use only --rid <selected encap resources>
whatever the flags used to do this selection.

With app#h3 a non-encap resource,

* Before:

	$ om c13lxc1 instance start --rid app#h3
14:38:39.588 INF c13lxc1: >>> do start [/tmp/om2 c13lxc1 instance start --rid app#h3] (origin user, sid 1e412b62-2d78-447f-8143-93f6458fd628)
14:38:39.809 INF c13lxc1: /usr/bin/lxc-attach -n c13lxc1 -P /srv/opensvc/containers/c13lxc1.root.vol/base --clear-env -v OSVC_SESSION_ID=1e412b62-2d78-447f-8143-93f6458fd628 -v OSVC_ACTION_ORIGIN=user -- /usr/bin/om c13lxc1 instance start --rid app#h3
14:38:39.860 ERR c13lxc1: container#1: exit status 1
14:38:40.247 INF c13lxc1: <<< done start [/tmp/om2 c13lxc1 instance start --rid app#h3] in 659.243843ms, instance status is now up, with warnings
Error: c13lxc1: container#1: exit status 1

* After:

	$ om c13lxc1 instance start --rid app#h3
	14:38:33.694 INF c13lxc1: >>> do start [/tmp/om c13lxc1 instance start --rid app#h3] (origin user, sid 524d98df-11a8-47eb-ac6c-39c784da6c1c)
	14:38:33.889 INF c13lxc1: app#h3: already up
	14:38:34.265 INF c13lxc1: <<< done start [/tmp/om c13lxc1 instance start --rid app#h3] in 570.61042ms, instance status is now up, with warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant