Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/controllers/WKRemoteDataStoreController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,9 @@ class WKRemoteDataStoreController @Inject()(
implicit request =>
dataStoreService.validateAccess(name, key) { _ =>
val okLabel = if (request.body.ok) "ok" else "not ok"
logger.debug(s"Status update from data store '$name'. Status $okLabel")
logger.debug(s"Status update from data store $name. Status $okLabel")
for {
_ <- dataStoreDAO.updateUrlByName(name, request.body.url)
_ <- dataStoreDAO.updateReportUsedStorageEnabledByName(name,
request.body.reportUsedStorageEnabled.getOrElse(false))
} yield Ok
}
}
Expand Down
6 changes: 0 additions & 6 deletions app/models/dataset/DataStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,6 @@ class DataStoreDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext
for { _ <- run(query.update(url)) } yield ()
}

def updateReportUsedStorageEnabledByName(name: String, reportUsedStorageEnabled: Boolean): Fox[Unit] =
for {
_ <- run(
q"UPDATE webknossos.dataStores SET reportUsedStorageEnabled = $reportUsedStorageEnabled WHERE name = $name".asUpdate)
} yield ()

def insertOne(d: DataStore): Fox[Unit] =
for {
_ <- run(q"""INSERT INTO webknossos.dataStores
Expand Down
2 changes: 1 addition & 1 deletion conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ webKnossos {
}
annotation.mutex.expiryTime = 2 minutes
fetchUsedStorage {
# Note that storage is only scanned for datastores that have `reportUsedStorageEnabled=TRUE` in postgres.
rescanInterval = 24 hours # do not scan organizations whose last scan is more recent than this
tickerInterval = 10 minutes # scan some organizations at each tick
scansPerTick = 10 # scan x organizations at each tick
Expand Down Expand Up @@ -220,7 +221,6 @@ datastore {
interval = 1 minute
initialDelay = 5 seconds
}
reportUsedStorage.enabled = false
cache {
mapping.maxEntries = 5
imageArrayChunks.maxSizeBytes = 2000000000 # 2 GB
Expand Down
2 changes: 1 addition & 1 deletion test/db/dataStores.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name,url,publicUrl,key,isScratch,isDeleted,allowsUpload,allowsManualUpload,onlyAllowedOrganization,reportUsedStorageEnabled
'localhost','http://localhost:9000','http://localhost:9000','something-secure',f,f,t,t,,f
'localhost','http://localhost:9000','http://localhost:9000','something-secure',f,f,t,t,,t
5 changes: 5 additions & 0 deletions unreleased_changes/9024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Changed
- The datastore config option `reportUsedStorage.enabled` was removed. To enable storage scan, set it in postgres directly.

### Migration
- The datastore config option `reportUsedStorage.enabled` was removed. To enable storage scan for a datastore, set reportUsedStorageEnabled to TRUE directly in the postgres table `webknossos.dataStores`.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DataStoreConfig @Inject()(configuration: Configuration) extends ConfigRead
val blockSize: Int = get[Int]("datastore.cache.agglomerateFile.blockSize")
val cumsumMaxReaderRange: Long = get[Long]("datastore.cache.agglomerateFile.cumsumMaxReaderRange")
}
val children = List(Mapping, AgglomerateFile)
val children = List(Mapping, ImageArrayChunks, AgglomerateFile)
}
object AdHocMesh {
val timeout: FiniteDuration = get[FiniteDuration]("datastore.adHocMesh.timeout")
Expand All @@ -55,9 +55,6 @@ class DataStoreConfig @Inject()(configuration: Configuration) extends ConfigRead
object AgglomerateSkeleton {
val maxEdges: Int = get[Int]("datastore.agglomerateSkeleton.maxEdges")
}
object ReportUsedStorage {
val enabled: Boolean = get[Boolean]("datastore.reportUsedStorage.enabled")
}
object DataVaults {
val credentials: List[Config] = getList[Config]("datastore.dataVaults.credentials")
}
Expand All @@ -66,7 +63,7 @@ class DataStoreConfig @Inject()(configuration: Configuration) extends ConfigRead
val objectKeyPrefix: String = get[String]("datastore.s3Upload.objectKeyPrefix")
val credentialName: String = get[String]("datastore.s3Upload.credentialName")
}
val children = List(WebKnossos, WatchFileSystem, Cache, AdHocMesh, Redis, AgglomerateSkeleton, S3Upload)
val children = List(WebKnossos, WatchFileSystem, Cache, AdHocMesh, Redis, AgglomerateSkeleton, DataVaults, S3Upload)
}

object SlackNotifications {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import play.api.libs.json.{Json, OFormat}
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._

case class DataStoreStatus(ok: Boolean, url: String, reportUsedStorageEnabled: Option[Boolean] = None)
case class DataStoreStatus(ok: Boolean, url: String)
object DataStoreStatus {
implicit val jsonFormat: OFormat[DataStoreStatus] = Json.format[DataStoreStatus]
}
Expand Down Expand Up @@ -68,7 +68,6 @@ class DSRemoteWebknossosClient @Inject()(
private val dataStoreKey: String = config.Datastore.key
private val dataStoreName: String = config.Datastore.name
private val dataStoreUri: String = config.Http.uri
private val reportUsedStorageEnabled: Boolean = config.Datastore.ReportUsedStorage.enabled

private val webknossosUri: String = config.Datastore.WebKnossos.uri

Expand All @@ -79,7 +78,7 @@ class DSRemoteWebknossosClient @Inject()(
private def reportStatus(): Fox[_] =
rpc(s"$webknossosUri/api/datastores/$dataStoreName/status")
.addQueryParam("key", dataStoreKey)
.patchJson(DataStoreStatus(ok = true, dataStoreUri, Some(reportUsedStorageEnabled)))
.patchJson(DataStoreStatus(ok = true, dataStoreUri))

def reportDataSource(dataSource: DataSource): Fox[_] =
rpc(s"$webknossosUri/api/datastores/$dataStoreName/datasource")
Expand Down
1 change: 0 additions & 1 deletion webknossos-datastore/conf/standalone-datastore.conf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ datastore {
port = 6379
}
agglomerateSkeleton.maxEdges = 10000
reportUsedStorage.enabled = false
dataVaults {
# Global data vault access credentials. Not available during explore, only during data loading.
# Example: {type = "S3AccessKey", name = "s3://example/uri/prefix", identifier = "someKeyId", secret = "someSecret"}
Expand Down