Skip to content

Commit

Permalink
issue #1335 Upgrade to ArangoDB 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
wajda committed Jul 8, 2024
1 parent fcc2f96 commit 0e05272
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object AdminCLI extends App {
)
}

private val dbManagerFactory = new ArangoManagerFactoryImpl(activeFailover = false)
private val dbManagerFactory = new ArangoManagerFactoryImpl
private val maybeConsole = InputConsole.systemConsoleIfAvailable()

new AdminCLI(dbManagerFactory, maybeConsole).exec(args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait ArangoManagerFactory {
def create(connectionURL: ArangoConnectionURL, maybeSSLContext: Option[SSLContext], dryRun: Boolean): ArangoManager
}

class ArangoManagerFactoryImpl(activeFailover: Boolean)(implicit ec: ExecutionContext) extends ArangoManagerFactory {
class ArangoManagerFactoryImpl(implicit ec: ExecutionContext) extends ArangoManagerFactory {

override def create(connectionURL: ArangoConnectionURL, maybeSSLContext: Option[SSLContext], dryRun: Boolean): ArangoManager = {
val scriptRepo = MigrationScriptRepository
Expand All @@ -54,7 +54,7 @@ class ArangoManagerFactoryImpl(activeFailover: Boolean)(implicit ec: ExecutionCo
}

def dbFacade(): ArangoDatabaseFacade =
new ArangoDatabaseFacade(connectionURL, maybeSSLContext, activeFailover)
new ArangoDatabaseFacade(connectionURL, maybeSSLContext, activeFailover = false)

AutoClosingArangoManagerProxy.create(dbManager, dbFacade)
}
Expand Down
101 changes: 31 additions & 70 deletions arangodb-foxx-services/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package za.co.absa.spline.test.fixture

import com.arangodb.async.ArangoDatabaseAsync
import io.testcontainers.arangodb.containers.ArangoContainer
import za.co.absa.spline.persistence.ArangoDatabaseFacade.MinArangoVerRecommended
import za.co.absa.commons.version.Version._
import za.co.absa.spline.persistence.{ArangoConnectionURL, ArangoDatabaseFacade}

trait ArangoDbFixtureLike {
Expand All @@ -42,6 +42,6 @@ trait ArangoDbFixtureLike {
}

object ArangoDbFixtureLike {
private val ArangoDbVersion = MinArangoVerRecommended
private val ArangoDbVersion = ver"3.11"
private val ArangoDbContainer: ArangoContainer = new ArangoContainer(ArangoDbVersion.asString).withoutAuth()
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ object ArangoDatabaseFacade extends LazyLogging {

import za.co.absa.commons.version.Version._

val MinArangoVerRequired: Version = semver"3.6.0"
val MinArangoVerRecommended: Version = ver"3.10"
private val ArangoDBVerMinIncluding = semver"3.9.0"
private val ArangoDBVerMaxExcluding = Option(semver"3.12.0")

private def warmUpDb(db: ArangoDatabaseAsync): Unit = {
val verStr = try {
Expand All @@ -98,16 +98,10 @@ object ArangoDatabaseFacade extends LazyLogging {
val arangoVer = Version.asSemVer(verStr)

// check ArangoDb server version requirements
if (arangoVer < MinArangoVerRequired)
if (arangoVer < ArangoDBVerMinIncluding || ArangoDBVerMaxExcluding.exists(arangoVer.>=))
sys.error(s"" +
s"Unsupported ArangoDB server version ${arangoVer.asString}. " +
s"Required version: ${MinArangoVerRequired.asString} or later. " +
s"Recommended version: ${MinArangoVerRecommended.asString} or later.")

if (arangoVer < MinArangoVerRecommended)
logger.warn(s"WARNING: " +
s"The ArangoDB server version ${arangoVer.asString} might contain a bug that can cause Spline malfunction. " +
s"It's highly recommended to upgrade to ArangoDB ${MinArangoVerRecommended.asString} or later. " +
s"See: https://github.com/arangodb/arangodb/issues/12693")
s"Unsupported ArangoDB server version detected: ${arangoVer.asString}. " +
s"Please upgrade ArangoDB to version ${ArangoDBVerMinIncluding.asString} or higher" +
(ArangoDBVerMaxExcluding.map(v => s" (but less than ${v.asString} which is currently not supported).") getOrElse "."))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ArangoRepoConfig extends InitializingBean with LazyLogging {
@Bean def databaseVersionChecker: DatabaseVersionChecker = new DatabaseVersionChecker(databaseVersionManager)
}

object ArangoRepoConfig extends DefaultConfigurationStack with ConfTyped {
object ArangoRepoConfig extends DefaultConfigurationStack with ConfTyped with LazyLogging {

import za.co.absa.commons.config.ConfigurationImplicits._

Expand All @@ -67,8 +67,15 @@ object ArangoRepoConfig extends DefaultConfigurationStack with ConfTyped {
val DisableSSLValidation: Boolean =
conf.getBoolean(Prop("disableSslValidation"), false)

val ActiveFailoverMode: Boolean =
conf.getBoolean(Prop("activeFailover"), false)
val ActiveFailoverMode: Boolean = {
val enabled = conf.getBoolean(Prop("activeFailover"), false)
if (enabled) {
// Active failover mode is deprecated in Arango ver 3.11, and to be removed in ver 3.12.
// See https://docs.arangodb.com/3.11/release-notes/version-3.11/incompatible-changes-in-3-11/#active-failover-deployment-mode-deprecation
logger.warn("Active failover mode is deprecated and will be removed in the future versions.")
}
enabled
}
}

}

0 comments on commit 0e05272

Please sign in to comment.