Unistore : Ensure Watch works in HA mode. (#93428)
* Replace Watch with WatchNext * remove watchset * fix previous page and closing the channel * Remove the broadcaster cache to prevent dupplicated events * add watch bookmark * add watch bookmark * cleanup comments * disable the tests for bookmarks for now * Ensure we send previosu events * lint * re-introduce the cache * load from cache * disabling legacy test * disabling legacy test * Update pkg/storage/unified/resource/server.go Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com> * Could not read previous events * add proper migration * Add previous_resource_version to both history and resource * First event should have an RV of 2 and not 1 * Test both storage backends * fix the inital RV for the sql backend * ensure graceful stop of the stream decoder * gocyclo --------- Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
This commit is contained in:
co-authored by
Diego Augusto Molina
parent
e1146120f4
commit
0a26c9e9ae
@@ -227,7 +227,7 @@ func TestResourceVersionAtomicInc(t *testing.T) {
|
||||
|
||||
v, err := resourceVersionAtomicInc(ctx, b.DB, dialect, resKey)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), v)
|
||||
require.Equal(t, int64(2), v)
|
||||
})
|
||||
|
||||
t.Run("happy path - update existing row", func(t *testing.T) {
|
||||
@@ -304,7 +304,7 @@ func TestBackend_create(t *testing.T) {
|
||||
|
||||
v, err := b.create(ctx, event)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), v)
|
||||
require.Equal(t, int64(2), v)
|
||||
})
|
||||
|
||||
t.Run("error inserting into resource", func(t *testing.T) {
|
||||
@@ -409,7 +409,7 @@ func TestBackend_update(t *testing.T) {
|
||||
|
||||
v, err := b.update(ctx, event)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), v)
|
||||
require.Equal(t, int64(2), v)
|
||||
})
|
||||
|
||||
t.Run("error in first update to resource", func(t *testing.T) {
|
||||
@@ -513,7 +513,7 @@ func TestBackend_delete(t *testing.T) {
|
||||
|
||||
v, err := b.delete(ctx, event)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), v)
|
||||
require.Equal(t, int64(2), v)
|
||||
})
|
||||
|
||||
t.Run("error deleting resource", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user