Skip to content

Commit

Permalink
Remove lasso SQL cache mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleb committed Feb 3, 2025
1 parent 039bb21 commit b3fcf13
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type Options struct {
AggregationSecretName string
ClusterRegistry string
ServerVersion string
// SQLCache enables the SQLite-based lasso caching mechanism
// SQLCache enables the SQLite-based caching mechanism
SQLCache bool

// ExtensionAPIServer enables an extension API server that will be served
Expand Down
4 changes: 2 additions & 2 deletions pkg/sqlcache/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ that contains the functionality needed to conform to cache.Indexer.
### SQLite Driver
There are multiple SQLite drivers that this package could have used. One of the most, if not the most, popular SQLite golang
drivers is [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3). This driver is not being used because it requires enabling
the cgo option when compiling and at the moment lasso's main consumer, rancher, does not compile with cgo. We did not want
the cgo option when compiling and at the moment steve's main consumer, rancher, does not compile with cgo. We did not want
the SQL informer to be the sole driver in switching to using cgo. Instead, modernc's driver which is in pure golang. Side-by-side
comparisons can be found indicating the cgo version is, as expected, more performant. If in the future it is deemed worthwhile
then the driver can be easily switched by replacing the empty import in `pkg/cache/sql/store` from `_ "modernc.org/sqlite"` to `_ "github.com/mattn/go-sqlite3"`.
Expand All @@ -117,7 +117,7 @@ connections attached to a sql.Connection. `database/sql` manages this connection
application only need one sql.Connection, although sometimes application use two: one for writes, the other for reads. To
read more about the `sql` package's connection pooling read [Managing connections](https://go.dev/doc/database/manage-connections).

The use of connection pooling and the fact that lasso potentially has many go routines accessing the same connection pool,
The use of connection pooling and the fact that steve potentially has many go routines accessing the same connection pool,
means we have to be careful with writes. Exclusively using sql transaction to write helps ensure safety. To read more about
sql transactions read SQLite's [Transaction docs](https://www.sqlite.org/lang_transaction.html).

Expand Down
2 changes: 1 addition & 1 deletion pkg/sqlcache/db/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

const (
// InformerObjectCacheDBPath is where SQLite's object database file will be stored relative to process running lasso
// InformerObjectCacheDBPath is where SQLite's object database file will be stored relative to process running steve
InformerObjectCacheDBPath = "informer_object_cache.db"

informerObjectCachePerms fs.FileMode = 0o600
Expand Down
4 changes: 2 additions & 2 deletions pkg/stores/sqlpartition/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (

"github.com/rancher/apiserver/pkg/types"
"github.com/rancher/steve/pkg/accesscontrol"
lassopartition "github.com/rancher/steve/pkg/sqlcache/partition"
cachepartition "github.com/rancher/steve/pkg/sqlcache/partition"
"github.com/rancher/steve/pkg/stores/partition"
)

// Partitioner is an interface for interacting with partitions.
type Partitioner interface {
All(apiOp *types.APIRequest, schema *types.APISchema, verb, id string) ([]lassopartition.Partition, error)
All(apiOp *types.APIRequest, schema *types.APISchema, verb, id string) ([]cachepartition.Partition, error)
Store() UnstructuredStore
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/stores/sqlproxy/proxy_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func gvkKey(group, version, kind string) string {
return group + "_" + version + "_" + kind
}

// getFieldsFromSchema converts object field names from types.APISchema's format into lasso's
// getFieldsFromSchema converts object field names from types.APISchema's format into steve's
// cache.sql.informer's slice format (e.g. "metadata.resourceVersion" is ["metadata", "resourceVersion"])
func getFieldsFromSchema(schema *types.APISchema) [][]string {
var fields [][]string
Expand Down

0 comments on commit b3fcf13

Please sign in to comment.