Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward compatibility tests for extensions #9206

Open
lubennikovaav opened this issue Sep 30, 2024 · 0 comments
Open

Backward compatibility tests for extensions #9206

lubennikovaav opened this issue Sep 30, 2024 · 0 comments
Assignees

Comments

@lubennikovaav
Copy link
Contributor

lubennikovaav commented Sep 30, 2024

Add backward compatibility tests which we could use when we want to bump version from N to M
part of https://github.com/neondatabase/company_projects/issues/291

Motivation

Currently, we update extensions by changing version in the Dockerfile.compute-node.
It is hard to tell, if new extension binary works with objects created by previous version.

DoD

We have test coverage that allows us to perform extension updates safely.

Implementation ideas

  1. First idea is to add CREATE EXTENSION for all available extensions to backward_compatibility snapshot.
    This will help to catch simple cases, when extension is missing in the new image.

  2. Testing backward compatibility is a very broad task, because extension may create lots of SQL objects (functions, tables, views) and change their signatures and internal logic arbitrary. One thing that is relatively easy to test is that new .so has all the functions, needed for previously installed version of extension. We can compare function signatures using query like this and comparing results before and after image update:

SELECT e.extname, p.proname, p.proargtypes, p.prorettype
FROM pg_catalog.pg_extension AS e
    INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid)
    INNER JOIN pg_catalog.pg_proc AS p ON (p.oid = d.objid)
WHERE d.deptype = 'e'
ORDER BY e.extname, p.proname;
  1. We can also run ALTER EXTENSION extname UPDATE on a backward compatibility snapshot data, to ensure that update path is present.
    This probably won't work for some extensions, test DROP extension + CREATE extension for them.

Other related tasks and Epics

need review from @neondatabase/developer-productivity
Ideas are welcome.

Questions:

  • Is it a good place to add such test?
  • Do we only run this test for release branch PRs? Can we also run it for normal PRs that change Dokerfile.compute-node?
@lubennikovaav lubennikovaav self-assigned this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant