Upgrading
The general procedure
- Read the section below that matches the version you are leaving.
- Upgrade the API first, with its database migrations. See Husonym Migrations.
- Replace every worker in one rollout. A run must not be shared between two versions of the worker: stop the previous workers before the new ones take runs, or pause the schedules meanwhile.
- Upgrade the web app.
Do not go back to a previous version of the worker while runs are in progress.
Upgrading from v0.2
Workers
Follow step 3 above strictly. A run that a new worker has taken waits, or fails, when a worker of the previous version picks it up.
License
The API starts whatever the license, and reads it on every request. The worker asks the API for it, and takes no job run until the API has answered once.
The key in force is now kept in the database of the API. At its first start, the API takes
the key from EE_LICENSE or EE_LICENSE_FILE into the database, and from then on the
database holds it. The variables stay useful as ways to install a newer key: the API
offers what they hold at each start (and the file again when its content changes), and
keeps a key only when it is newer than the one it holds. A key can also be installed from the
License page of the settings. The upgrade adds one table to the database, through a
migration that can be reversed.
The worker no longer reads a license variable: it asks the API for the key. If EE_LICENSE
or EE_LICENSE_FILE was set only on the worker, it must now be set on the API, because the
worker takes the key from the API. Until then the instance has no license: the API starts no
job run.
A worker that starts takes no job run until the API has answered it once about the license
(an API that holds no key has answered). If a run reaches its job hooks on a worker that
holds no license in force, the run fails rather than skip them, with
the worker has not received the instance's license yet: job hooks were not run.
The logs of a run are readable without a license in force, as they were before this version. An account that has already declared its identity provider can replace it whatever the license.
Keys that were issued before this version keep working and allow everything. See
Licensing for what a valid license is needed for, for the features and
the sources a license may limit, and for EE_LICENSE_FILE, which lets a renewed license
take effect without a restart.
Check after upgrading.
- Upgrade the API before the worker: a new worker asks the API for the license, and takes no job run until the API has answered.
- The License page shows the state you expect, and where the key came from (the environment, a file, or the interface).
- The log of the worker says that it obtained the license from the API. A worker that is still waiting says so, and why.
Rolling back. Once the new worker has started job runs, do not roll the worker back to the previous version while some of those runs are still open: their history holds entries that the previous version does not expect, so they cannot make progress until the worker is upgraded again. Let the open runs finish, or cancel them, before rolling a worker back.
Rolling the API back keeps the license, with these cares:
- The previous version only reads its environment. If a newer key was installed from the
License page since the upgrade, put that key into
EE_LICENSEorEE_LICENSE_FILEon the API before rolling it back. - The previous worker reads its own license variable. Keep
EE_LICENSEorEE_LICENSE_FILEset on the worker for as long as a rollback is intended, even though the new worker ignores it. - A new worker in front of a rolled-back API obtains no key from it, and waits: it takes no job run. Roll the worker back together with the API.
The extra table is ignored by the previous version, or removed by the reverse migration.
Usage report
From this version, an instance prepares a daily report of its usage and sends it when its
license provides for it; the first report waits 24 hours, and the License page shows it
beforehand. See Usage report. If you filter outbound traffic, the one
host to allow is license.husonym.com, over HTTPS.
Roles
The access rules of the four roles are part of the product. The rule rows that earlier versions stored for each account stay in the database and are no longer read: a rule added there by hand has no effect. The role of each member is kept.
Setting a role that does not exist is refused with invalid_argument.
In the web app, the role controls are shown when RBAC_ENABLED is true. See
Environment Variables.
Job hooks and account hooks
Clients that call the hook procedures of the API should expect these answers:
not_foundfor a hook, a job or an account the caller cannot seealready_existsfor a name already takeninvalid_argumentfor a missing or invalid configuration, and for a webhook URL that is not anhttporhttpsURL with a host
Turning a hook on asks for the same permissions and the same license as modifying it.
The secret of a webhook is shown only to callers who may edit the account; others read a mask. A request that sends the mask back as the secret is refused: send the secret itself when updating a webhook.
Webhook deliveries carry three more headers, are not repeated after an answer that cannot succeed, and do not follow redirects. See Account Hooks.
Presidio
The API calls the Presidio analyzer only. PRESIDIO_ANONYMIZER_URL is no longer read. See
Environment Variables.
The analyzer image
If you run the analyzer image of docker/presidio-fr/, rebuild it:
docker compose -f compose.dev.yml up -d --build presidio-analyzer. Building needs the
network; running does not. The service of compose.dev.yml now carries
pull_policy: build, so up builds the image every time. With a compose file of your own
that does not, or with docker run, an image built before this version is started as it
is: it starts, answers on /health, and answers every French call with a 500 error,
"No matching recognizers were found". Rebuilding the image is the fix.
The image recognizes French persons with a language model, so it is a little larger and
slower per French text. Measured once on one host, against the image before the change:
1.95 GB instead of 1.69 GB, 1.16 GiB of memory after start-up instead of 1.12 GiB, and 8 s
before /health answers instead of 6.5 s without a CPU quota (10 s on one CPU, 31 to 37 s
on half a CPU). Each analyzer process loads the model: size WORKERS and
OMP_NUM_THREADS of the image as its README.md says.
The time a French text takes grows with its length more than it did. Observed per 1,000
characters: 0.06 s for prose and 0.2 s for text with little whitespace, such as compact
JSON, without a CPU quota; 0.15 s for prose and 0.3 to 0.5 s for compact JSON on one CPU;
0.3 s for prose on half a CPU. Against the previous engine, a short value takes about
twice as long, a long prose text about four times, and a text with little whitespace
about fifteen times. Husonym waits 60 seconds for the analyzer: a text whose analysis
takes longer fails the value. Check the longest French values of the columns you map to
Transform PII Text against these rates and the CPUs you give the analyzer. The image's
worker timeout is now a setting, WORKER_TIMEOUT, 120 seconds by default.
The configuration is now inside the image. Files that an older compose file mounted over it are no longer needed, and would override it: remove those mounts.
French verdicts and rewritten passages change. On the invented business text of the
image's measure, no value of 300 in columns that name no person was designated as a
person, against 32 before; fewer product and company names are taken for persons. The
gain has a price: on the same text the previous engine found 32 of the 32 names, among
106 passages of which 32 were on a name, and the new one finds 31 of 32. A name can
occasionally be left as it is where it used to be rewritten; the cases measured are a
given name written alone, without a family name, and a name inside text with almost no
spaces, such as compact JSON. Review the verdicts of the PII content scan again, and the
output of Transform PII Text on French text. See
Transform PII Text.
Microsoft SQL Server destinations
Initializing the schema needs a source database at compatibility level 130 or more, and
a source login that holds VIEW DEFINITION on it. See
Schema initialization.
Columns mapped by AutoMap
With AutoMap & Review, a run decides the mapping of each column added to the source since the job was configured. More column names are now recognized as personal data, in eight languages, and every recognized column of a known type is rewritten. On PostgreSQL and MySQL, a column held by a CHECK constraint is copied as is, and the run log names it.
After the first run that follows the upgrade, review the mappings the run has written into the job. See New Column Addition Strategies.
Virtual foreign keys
Before upgrading, review the virtual foreign keys of your jobs. A job whose virtual foreign key references a table or a column that the source does not hold fails at the start of the run, with an error that names the table of the key, the table it references and, for a column, the column. The pre-flight check stops with the same error instead of listing it among its findings.
The names are compared exactly as the catalog of the source writes them. A key that names its referenced table or column in another case than the catalog ran before on a server that compares names without regard to case; it now stops the run. Spell the names as the catalog does. See Virtual Foreign Keys.
Names and text copied from the source
Tables, columns and other objects whose names hold a quote character, an apostrophe, a backslash, a space or upper-case letters, and column defaults and enum labels that hold an apostrophe or a backslash, are copied as they are by schema initialization on PostgreSQL, MySQL, MariaDB and SQL Server, and by a sync run by the Athanor engine from PostgreSQL, MySQL or MariaDB.
On MySQL, a check constraint whose expression holds a backslash, a line break or a character outside ASCII is recreated as on the source, and so is a column default that is a plain string holding an apostrophe or a backslash. On PostgreSQL, the labels of an enum type are created in the order of the source; a type created by an earlier version in another order is not reordered.
A MySQL source whose sessions run under the NO_BACKSLASH_ESCAPES SQL mode is read. On a
PostgreSQL source that has standard_conforming_strings off, the default of a mandatory
foreign key column that holds a backslash is recognized as the value that stands for "no
parent", as it is with the setting on.
Known limits:
- A schema or table name that holds a dot is not supported.
- On PostgreSQL, a column default or a check constraint whose text holds a backslash is
copied as it is only between a source and a destination that have the same
standard_conforming_stringssetting. From a source that has it on to a destination that has it off, the destination refuses the statement or reads the text differently; from a source that has it off to a destination that has it on, each backslash is copied twice. - On MySQL and MariaDB, a column comment that holds a backslash is not copied.
- On MySQL, a function whose parameter names need quoting is not created.
- On SQL Server, a column whose collation name is not made of letters, digits and underscores takes the default collation of the destination database, and the run reports it.
Sampled rows
The rows read to recognize personal data (the PII content scan, the column preview and the PII detection job) are drawn from the whole table where the database allows it, so two scans of the same table can read different rows. See Data sampling.
PII detection jobs
See Upgrading in the guide of the PII detection job.
In the web app, the job is offered when PII_DETECTION_JOB_ENABLED is true.