mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
eb955e939dcebf818d55fb40407fa357d12266d7
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e1c6221f22 |
FerretDB: connect with directConnection=true, so a fresh docker compose up starts.
A new install with nothing changed but the port and ROOT_URL could not reach the
database at all:
MongoServerSelectionError: connect ECONNREFUSED 0.0.0.0:27017
reason: TopologyDescription { type: 'ReplicaSetNoPrimary',
servers: Map(1) { '0.0.0.0:27017' => [ServerDescription] },
setName: 'rs0', ... }
0.0.0.0 is in no compose file. It is FerretDB's own listen address, and the
driver was handed it by the server.
The ferretdb service runs with --repl-set-name=rs0, added in #6480/#6481 so
Meteor can tail an OpLog instead of poll-and-diff. FerretDB therefore answers the
hello handshake as a one-member replica set, and fills hosts, me and primary with
its --listen-addr, which is the wildcard 0.0.0.0:27017. A driver that is not in
direct-connection mode reads that reply as an invitation to do replica-set
DISCOVERY: it adopts the advertised member list and drops the seed it was given,
because the server reports a name other than the one that was dialled. So
mongodb://ferretdb:27017 became 0.0.0.0:27017, which inside the wekan container is
the wekan container itself, where nothing listens.
Measured against FerretDB v1.49.0 - the version reported - with the mongodb
driver the bundle ships:
mongodb://localhost:27017/wekan
-> ReplicaSetWithPrimary, servers: 0.0.0.0:27017 (the seed discarded)
mongodb://localhost:27017/wekan?directConnection=true
-> Single, servers: localhost:27017
directConnection=true keeps the driver on exactly the host it was given. It costs
nothing else: the handshake still reports setName rs0, which is the only thing
Meteor checks before it will tail an OpLog (accounts for the check in the mongo
package's oplog_replica_set_error.js), so #6480/#6481 are unaffected and the
commented MONGO_OPLOG_URL examples keep replicaSet=rs0 beside it.
All five FerretDB v1 compose files are fixed, being the ones that start FerretDB
with --repl-set-name. The MongoDB compose files are deliberately left alone: those
are real replica sets whose members are reachable under the names they advertise,
and directConnection would pin Meteor to a single node of one.
tests/ferretdbDirectConnection.test.cjs pins both halves - that a compose file
running FerretDB as a replica set carries directConnection=true on every URL
pointing at it, and that the MongoDB ones do not.
Thanks to Dandrass and xet7 !
Fixes #6582,
|
||
|
|
5ec9f3ae5b |
Document the CPU platforms of the Docker image, beside the snap's.
"Which CPUs is this published for, and why not that one" was answerable for the snap and nowhere else, so the same page now exists for the image: docs/Platforms/FOSS/Container/Docker/CPU-platforms.md. It carries the platform matrix with each platform's TARGETARCH, TARGETVARIANT and bundle, how the set is decided on every release from what the base image publishes and which bundles landed, the three names that differ between Docker, Debian and the WeKan bundles, and one section per platform that is deliberately NOT an image: loong64 (no base image exists at any tag), armv6 (gated on a base with arm/v6), armv7 (the one 32-bit ARM slot must carry the armhf baseline) and the Windows and macOS bundles. It ends with why the FerretDB image covers more platforms than the WeKan one - FROM scratch around a static Go binary needs no userland at all. The snap's page gains the matching armv6 section - the Snap Store has no armv6 architecture, and its only 32-bit ARM is armhf, which an ARMv6 board cannot run - and a table of all fifteen bundles against which six become snaps, so "it is missing" and "it cannot be there" stop looking alike. The two pages link each other, because the answer differs between them. docs/Databases/FerretDB/1/README.md said the per-architecture FerretDB binary was embedded in the bundles "for ppc64le, s390x, riscv64". Every bundle carries one; those three are part of a longer list of platforms where it is the DEFAULT because MongoDB publishes no server. It now lists all seventeen built binaries and separates the three 32-bit ARM builds that are not variants of each other: armhf is GOARM=7, armv6 is GOARM=6, armel is GOARM=5 software floating point. Thanks to xet7 ! |
||
|
|
4541fa99e1 |
Database tests run on their own ports, and survive their first real run.
Three things the first run on arm64 found. The FerretDB it built could not start: `panic: commit.txt value ... != vcs.revision value ...`. Go stamps the VCS revision into the binary and FerretDB's build/version panics when it disagrees with the committed commit.txt, which only the generator refreshes - so every commit made after the last refresh built a binary that panicked. Fixed in the fork (its act_build now regenerates them, as act_dist already did). Ports: FerretDB listened on 27017, which is where a dev server's database lives and where the compose files publish FerretDB - so this could not run beside anything else and, worse, could have pointed the tests at somebody else's database and rewritten it. It listens on 37017 now and publishes the database server on 35432, both moved on if busy, both overridable with WEKAN_CONFORMANCE_PORT and WEKAN_CONFORMANCE_DB_PORT, and its containers are named per run so a compose stack is never reused or stopped. And Ctrl-C only killed whatever was in the foreground - a registry lookup, a sleep - after which the loop carried on and reported the interrupted lookup as "NO linux/arm64", which is a lie about the image. An interrupt ends the run now, and the image check has three outcomes rather than two: has it, does not have it, could not ask. A FerretDB that will not start also prints the last lines of its log, because the reason is usually one line. Thanks to xet7 ! |
||
|
|
7a3783fbe6 |
Tests menu: run every database this CPU can, and check they answer the same.
FerretDB v1 translates one MongoDB query into five different SQL dialects, so
"WeKan starts on MariaDB" says very little. The question that decides whether a
backend can be trusted with a board is whether {n: {$gt: 5}} returns the same
documents, in the same order, as it does on SQLite - and nothing was asking it.
./build.sh -> Tests -> "All databases (sequential)" now does, and build.bat has
the same entry (running the same script through bash rather than a second
implementation that would drift).
It builds FerretDB v1 from source first: the FerretDB subdirectory is cloned
from git@github.com:wekan/FerretDB if it is not there, updated if it is, and
built through its own build.sh, which installs the Go toolchain and the module
dependencies when they are missing. The tests run against THAT binary, not a
downloaded release, so they test the newest code.
Then, for each backend whose database image has a build for THIS CPU - asked of
the registry with docker manifest inspect, so no table here can go stale - it
starts that database, runs the freshly built FerretDB against it, runs the whole
catalogue and stops everything. Sequential, because they all use the same
FerretDB port and a database under test should not be competing with three
others; the menu entry says so.
The catalogue is 100 cases in 15 groups, taken from FerretDB v1's own handler
sources rather than from MongoDB's manual: every query, update and bitwise
operator, the aggregation stages and accumulators, projection and sorting and
paging, count and distinct, indexes and uniqueness, capped collections (which is
how the OpLog exists at all), and the commands whose answers may legitimately
differ. The seed data is deliberately awkward - a null, a missing field, a
negative number, a zero, an empty array, an array of documents - because tidy
data lets a broken translation pass.
Answers are normalised and compared byte for byte against SQLite, so document
ORDER counts. Three cases are compared loosely and say so: an explain plan
differs per engine by definition, and collStats/dbStats are sizes a different
storage engine may answer differently. Two backends failing the same way is
agreement about a limitation; one answering where another fails is a difference.
Everything lands in ../log/<datetime>/ with every other test run: a JSON of what
each backend answered, each backend's container output, the build log, a summary
and db-conformance-report.md. SAP HANA is opt-in behind WEKAN_CONFORMANCE_HANA=1
- amd64-only, ~16 GB of RAM, and SAP's licence to accept - so a menu choice
cannot start it by accident.
Thanks to xet7 !
|
||
|
|
67991587d4 |
Alternatives.md: group the databases by family, and lead with the summary.
The page listed images and requirements, which left the reader to work out the pattern themselves. There is a pattern: the databases are not fifteen separate questions but seven families, and inside a family the answer is the same one. Each family now says what IT is missing. PostgreSQL-wire and MySQL-wire need no code at all, only a live run against their dialect - that is where CockroachDB's s390x image could be won. Enterprise SQL needs a whole backend each, and the driver is the obstacle only for Db2, whose cgo-only driver cannot be in a nine-architecture build. Embedded databases need a pure-Go driver before anything else. Columnar engines pass the driver gate and fail the second one: WeKan updates single cards constantly, and they are built for the opposite. Key-value stores would have to have indexes, filters and atomicity implemented inside FerretDB, which is not a backend but a database. And what already speaks MongoDB needs no FerretDB at all - the reason for this page is that on ppc64le, s390x, riscv64 and loong64 that family has no members. The page opens with all of it in five sentences and one table, because the conclusion - that the most valuable work is verifying the three backends that already exist, not writing a fourth - was previously only visible to whoever read to the end. Corrections while checking: Oracle DOES have a pure-Go driver (sijms/go-ora implements the TNS protocol itself), so it is not blocked by cgo the way Db2 is; and Cassandra belongs in the CPU table, since its image covers ppc64le and s390x. Thanks to xet7 ! |
||
|
|
69f2be1161 |
Document which other databases run on many CPUs, and what a backend costs.
WeKan runs on every CPU Node.js runs on, and this fork of FerretDB v1 exists because MongoDB does not publish a server for most of them. Two questions kept coming back: which databases even have images for those CPUs, and what would be missing in FerretDB v1 before it could store into one. docs/Databases/FerretDB/1/Alternatives.md answers both. The architecture table is read from each registry's own manifest, not from documentation, and it says plainly what that data shows: PostgreSQL is the only widely-portable database server - the only one publishing ppc64le, s390x AND riscv64 - MariaDB covers ppc64le and s390x, MySQL neither, and MongoDB itself and upstream FerretDB 2 are amd64 + arm64 only. This fork's own image covers nine platforms. What a new backend needs is taken from the code: a pure-Go driver, because the binaries are built CGO_ENABLED=0 and that is what makes one build serve nine architectures (which is why Oracle and Db2 are out, despite Db2's ppc64le and s390x images); the three backends interfaces, none of them stubbable; a metadata registry; the SQL features the translation actually uses - JSON path extraction, containment and type inspection, schemas, expression indexes, a parseable EXPLAIN, and the record-id column that capped collections and therefore the OpLog are built on; correct MongoDB semantics on top; and a live integration run, which is the whole difference between the confirmed and experimental rows. And the shortcut: a database that speaks the PostgreSQL or MySQL wire protocol needs no new backend, only an existing one that survives its dialect - CockroachDB brings s390x that way, for the price of a test run. Thanks to xet7 ! |
||
|
|
fea3c432e8 |
Organize docs/Databases: one directory per database.
It was a flat list where the database was a filename prefix, in three spellings - MongoDB-Driver-System.md, mongodb-avx-qemu.md, MongoDB_OpLog_Enablement.md - plus FerretDB2-PostgreSQL.md and a ToroDB-PostgreSQL directory. Somebody asking "how do I run WeKan on PostgreSQL" had to read the prefixes to find out which files were even about their database. Now: Migrations, MongoDB, FerretDB (with 1 and 2, because v1 and v2 are different products with different backends) and ToroDB (with PostgreSQL). Each file keeps its name minus the redundant prefix - MongoDB/Driver-System.md, MongoDB/avx-qemu.md - and the old PostgreSQL.md, which was an index of FerretDB and ToroDB rather than a document about PostgreSQL, becomes the directory's README.md. Every directory has a README.md saying what is in it and where to go next, including FerretDB/1, which had no documentation at all until now although it is WeKan's default database and just gained four more backends. Links to a directory point at the DIRECTORY, not at its README.md, because README.md is what is opened by default. Every link that pointed into the old paths is updated - in docs, in docker-compose-ferretdb-v2-postgresql.yml, and in the wekan.fi website - and the relative links inside the moved files, which gained a directory level and so needed one more "../". tests/docsDatabases.test.cjs pins the layout, the READMEs, the directory links, that every relative link resolves, and that nothing outside CHANGELOG.md still names an old path. Thanks to xet7 ! |