diff --git a/.drone.jsonnet b/.drone.jsonnet index d2ca69b16..dbe2edf93 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -90,11 +90,13 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise') 'mkdir -p ' + builddir, 'cd ' + builddir, 'wget https://raw.githubusercontent.com/mariadb-corporation/mariadb-columnstore-engine/fdb_build/tests/scripts/fdb_build.sh', + 'wget https://raw.githubusercontent.com/mariadb-corporation/mariadb-columnstore-engine/fdb_build/tests/scripts/mariadb_foundationdb-7.1.63_gcc.patch', 'bash fdb_build.sh', 'mkdir -p /drone/src/' + result, 'ls -al fdb_build/packages', 'cp fdb_build/packages/*.' + pkg_format + ' /drone/src/' + result, - if(pkg_format == 'rpm') then 'createrepo /drone/src/' + result else 'dpkg-scanpackages /drone/src/%s | gzip > /drone/src/%s/Packages.gz' % [result, result], + 'cd /drone/src', + if(pkg_format == 'rpm') then 'createrepo ./' + result else 'dpkg-scanpackages %s | gzip > ./%s/Packages.gz' % [result, result], ], }, ] + @@ -123,8 +125,9 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise') 'wget https://raw.githubusercontent.com/mariadb-corporation/mariadb-columnstore-engine/develop/setup-repo.sh -O setup-repo.sh', 'docker cp setup-repo.sh ' + smoke_docker_name + ':/', execInnerDocker('bash /setup-repo.sh', smoke_docker_name), - execInnerDocker(installRpmDeb(pkg_format, 'foundationdb-clients foundationdb-server', 'foundationdb-clients foundationdb-server'), smoke_docker_name), + execInnerDocker(installRpmDeb(pkg_format, 'foundationdb-clients foundationdb-server jq', 'foundationdb-clients foundationdb-server jq'), smoke_docker_name), execInnerDocker("fdbcli --exec 'status json'", smoke_docker_name), + execInnerDocker("fdbcli --exec 'status json' | jq .client", smoke_docker_name), execInnerDocker("service foundationdb status || true", smoke_docker_name), execInnerDocker("fdbcli --exec 'writemode on; set foo bar; get foo", smoke_docker_name), ], diff --git a/tests/scripts/fdb_build.sh b/tests/scripts/fdb_build.sh index 352c30956..6ad1117ae 100644 --- a/tests/scripts/fdb_build.sh +++ b/tests/scripts/fdb_build.sh @@ -104,7 +104,10 @@ wget https://github.com/apple/foundationdb/archive/refs/tags/${FDB_VERSION}.zip unzip -q ${FDB_VERSION}.zip message "Patching sources" -sed -i "s/O_WRONLY | O_CREAT | O_TRUNC/O_WRONLY | O_CREAT | O_TRUNC, 0666/g" foundationdb-${FDB_VERSION}/fdbbackup/FileDecoder.actor.cpp +cd foundationdb-${FDB_VERSION} +patch -p1 -i mariadb_foundationdb-7.1.63_gcc.patch +cd - + message "Configuring cmake" mkdir -p fdb_build diff --git a/tests/scripts/mariadb_foundationdb-7.1.63_gcc.patch b/tests/scripts/mariadb_foundationdb-7.1.63_gcc.patch new file mode 100644 index 000000000..ffea8e998 --- /dev/null +++ b/tests/scripts/mariadb_foundationdb-7.1.63_gcc.patch @@ -0,0 +1,54 @@ +--- a/fdbbackup/FileDecoder.actor.cpp 2024-07-30 10:36:30.000000000 +0000 ++++ b/fdbbackup/FileDecoder.actor.cpp 2024-08-07 16:33:00.486048698 +0000 +@@ -643,7 +643,7 @@ + platform::createDirectory(path); + } + } +- self->lfd = open(self->file.fileName.c_str(), O_WRONLY | O_CREAT | O_TRUNC); ++ self->lfd = open(self->file.fileName.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (self->lfd == -1) { + TraceEvent(SevError, "OpenLocalFileFailed").detail("File", self->file.fileName); + throw platform_error(); +@@ -740,7 +740,7 @@ + } + } + +- self->lfd = open(self->file.fileName.c_str(), O_WRONLY | O_CREAT | O_TRUNC); ++ self->lfd = open(self->file.fileName.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (self->lfd == -1) { + TraceEvent(SevError, "OpenLocalFileFailed").detail("File", self->file.fileName); + throw platform_error(); +--- a/fdbbackup/backup.actor.cpp 2024-07-30 10:36:30.000000000 +0000 ++++ b/fdbbackup/backup.actor.cpp 2024-08-12 17:09:30.349465435 +0000 +@@ -4103,10 +4103,12 @@ + // where the fdbbackup command hangs infinitely. 60 seconds should be more than + // enough for all cases to finish and 5 retries should also be good enough for + // most cases. ++ static const unsigned int transactionTimeout = 60000; ++ static const unsigned int transactionRetryTimeout = 5; + db->setOption(FDBDatabaseOptions::TRANSACTION_TIMEOUT, +- Optional(StringRef((const uint8_t*)60000, 8))); ++ Optional(StringRef((uint8_t*)&transactionTimeout, 8))); + db->setOption(FDBDatabaseOptions::TRANSACTION_RETRY_LIMIT, +- Optional(StringRef((const uint8_t*)5, 8))); ++ Optional(StringRef((uint8_t*)&transactionRetryTimeout, 8))); + } + + return result.present(); +@@ -4127,10 +4129,12 @@ + // where the fdbbackup command hangs infinitely. 60 seconds should be more than + // enough for all cases to finish and 5 retries should also be good enough for + // most cases. +- sourceDb->setOption(FDBDatabaseOptions::TRANSACTION_TIMEOUT, +- Optional(StringRef((const uint8_t*)60000, 8))); +- sourceDb->setOption(FDBDatabaseOptions::TRANSACTION_RETRY_LIMIT, +- Optional(StringRef((const uint8_t*)5, 8))); ++ static const unsigned int transactionTimeout = 60000; ++ static const unsigned int transactionRetryTimeout = 5; ++ db->setOption(FDBDatabaseOptions::TRANSACTION_TIMEOUT, ++ Optional(StringRef((uint8_t*)&transactionTimeout, 8))); ++ db->setOption(FDBDatabaseOptions::TRANSACTION_RETRY_LIMIT, ++ Optional(StringRef((uint8_t*)&transactionRetryTimeout, 8))); + } + + return result.present();