Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,14 @@ jobs:

# The control plane for vector indexes is not reachable over the wire while
# this backend declares no vector search capability, so its tests drive the
# storage layer directly against this job's PostgreSQL. They build their own
# throwaway databases; the connection string is the server, not a database.
# storage layer directly against this job's PostgreSQL. The write-transaction
# conflict tests force a deadlock, which also needs direct access. They build
# their own throwaway databases; the connection string is the server, not a
# database.
- name: Run PostgreSQL storage-level tests
env:
EXTENDDB_TEST_PG_CONNECTION_STRING: postgresql://postgres:devpass@127.0.0.1:5432
run: cargo test --release -p extenddb-storage-postgres --test vector_control_plane
run: cargo test --release -p extenddb-storage-postgres --test vector_control_plane --test twi_conflict

# The daemonized server logs to syslog; dump it so server-side failures
# are diagnosable from the job log.
Expand Down
10 changes: 10 additions & 0 deletions crates/core/src/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,16 @@ impl CancellationReason {
}
}

/// Create a reason for an item that another transaction holds.
#[must_use]
pub fn transaction_conflict() -> Self {
Self {
code: "TransactionConflict".to_owned(),
message: Some("Transaction is ongoing for the item".to_owned()),
item: None,
}
}

/// Create a reason for a validation error.
#[must_use]
pub fn validation_error(msg: impl Into<String>) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions crates/storage-postgres/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ macro_rules! bind_sk_fetch_optional {
.await
}
}
.map_err(|e| extenddb_storage::error::StorageError::Internal(e.to_string()))
.map_err($crate::data::index::db_error)
};
}

Expand Down Expand Up @@ -124,7 +124,7 @@ macro_rules! bind_sk_execute {
.await
}
}
.map_err(|e| extenddb_storage::error::StorageError::Internal(e.to_string()))
.map_err($crate::data::index::db_error)
};
}

Expand Down
Loading
Loading