Comments (10)
from bedrock.
Thanks for your report! We're undergoing a massive change that's unintentionally preventing that from working, but do think we'd like to support this functionality.
In the meantime, if you're looking for a non-code based work around, for our existing Bedrock deployments we just take down one node at a time (in a 4+ node cluster you can do this without incurring production downtime), use sqlite3
command line tools to go into interactive mode on the db and apply the schema change, then bring the node back up to replicate before taking down the next node. In a non-production environment or one with 3 nodes, you would just take down all the nodes, apply the change to each bedrock.db file, and then bring them back up.
from bedrock.
@tylerkaraszewski is this still a limitation of CONCURRENT transactions?
from bedrock.
Unless sqlite changed this without notifying us, then yes, it's still a limitation. I assume that's the case as I don't see them making this change without being asked specifically for it.
from bedrock.
from bedrock.
What do we need this for?
from bedrock.
from bedrock.
The idea behind concurrent commits is that they're automatically retryable.
If these two queries run simultaneously:
UPDATE table SET column = 1 WHERE key = 'A';
and
UPDATE table SET column = 2 WHERE key = 'A';
If they happen at the same time they conflict, and the second one is automatically retried and can succeed. At the end of the whole process, the value for column
is either 1 or 2 for the row with the key A
, but both queries succeed.
If you allow schema changes and run these two queries:
UPDATE table SET column = 1 WHERE key = 'A';
and
ALTER TABLE table RENAME to newTableName;
What happens when the second query finishes first? The first one conflicts, is automatically retried, and fails because the table it wants to write to doesn't exist.
Sure, we could detect queries that are going to change the DB schema and run them non-concurrently, but then that just exposes a host of other problems (like above) that we need to come up with solutions for.
from bedrock.
It's been a couple of years, has there been any updates on this issue?
We're using Prisma and the idea is to track changes to your database schema in code and be able to apply those changes in a known, repeatable manner both in development at deploy time. This same process is also part of Ruby on Rails. At deploy time any outstanding database migrations are run and new code referencing those changes is made live.
Changing the format of existing tables that are in use by the application in the middle of a deploy (someone executing a query against the "old" schema after the migration has run but before the code supporting that change is live) and the query will fail causing errors is a known issue, but is a generally accepted risk. This can be mitigated against, for example, by putting the site into maintenance mode.
If it's a node synchronization issue we can be sure that the migrations are only every applied to a single node, although it sounds like from @mcnamamj's comment that you actually need to apply DDL statements to each node individually?
from bedrock.
(Prisma here, which @cannikin mentioned) Saw the new release that probably includes this, but we are unfortunately blocked by another error right now so we can not really test if this now works: #818
from bedrock.
Related Issues (20)
- Failed to open TCP port 'localhost:9999': couldn't bind(errno=98 'Address already in use') HOT 2
- Failed to open TCP port 'localhost:3306': couldn't bind(errno=98 'Address already in use') HOT 2
- yaourt is no longer maintaned, should be replaced in the installation guide
- Formal Protocol Description? HOT 2
- Jobs plugin: NACK?
- macOS Monterey Build Failure HOT 2
- Last release in late 2020... is this project still a priority for Expensify? HOT 3
- Blocking queries until a write operation has synchronized across the cluster?
- Which units are used for peekTime, totalTime, etc...?
- Beginner experience needs polish.
- MySQL Plugin is broken HOT 2
- `test/test` looks for `bedrock` in the `PATH` HOT 4
- Can this project work in collaboration with https://github.com/tursodatabase/libsql ? HOT 1
- Probably a missconfig HOT 1
- MacOS port
- MySQL plugin is not processing command line arguments HOT 1
- libstuff/libstuff.h:5:10: fatal error: arpa/inet.h: No such file or directory HOT 1
- Make generate_series() available HOT 5
- controlport CLI param missing from help and causing address in use error
- --
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bedrock.