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

POC - Changes to use persistent recursive watch for PRS enabled collections #58

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0b03e7c
POC: use persistent and recursive watch on collection state.json
patsonluk Jun 15, 2023
b162486
removed unnecessary flag
patsonluk Jun 15, 2023
263edb6
Fixed test case failures
patsonluk Jun 15, 2023
c51deea
Reverted unnecessary change
patsonluk Jun 15, 2023
9843028
Reverted unncessary change
patsonluk Jun 15, 2023
54dc95d
Reverted unnecessary change
patsonluk Jun 15, 2023
27feb3d
Reverted unnecessary change
patsonluk Jun 15, 2023
4f23192
Code cleanup
patsonluk Jun 15, 2023
33e3ae6
Code cleanup and documentation
patsonluk Jun 15, 2023
8a9aa37
Code cleanup and documentation
patsonluk Jun 15, 2023
68fec05
Merge branch 'master' into patsonluk/zk-persistent-watch
patsonluk Jun 15, 2023
3cc0932
Fixed error after merge
patsonluk Jun 15, 2023
99fbf0b
Fixed closing coll with proper persistent watch removals
patsonluk Jun 15, 2023
7e06ee9
Reverted the wrapper change, we don't need to care about that right n…
patsonluk Jun 15, 2023
ecea256
Optimize the flow, we do not need to fetch data for PRS entry changes
patsonluk Jun 16, 2023
f5d52b9
Optimize the flow, we do not need to fetch data for PRS entry changes
patsonluk Jun 16, 2023
af6cd89
Fetch children on monitorData if recursive is true
patsonluk Jun 16, 2023
fafee86
Fetch children on monitorData if recursive is true
patsonluk Jun 16, 2023
b164281
Fetch children on monitorData if recursive is true
patsonluk Jun 16, 2023
5db1479
Simplified zkwatcherman's Callbacks interface, so implementator that …
patsonluk Jun 16, 2023
1ffab8c
Fixed recursive logic so it should handle reconnect/failure better
patsonluk Jun 19, 2023
e4f1809
renames for more descriptive field/param
patsonluk Jun 19, 2023
9e7b22d
Updated zk ref to avoid
patsonluk Jun 20, 2023
f8c200e
go mod tidy
patsonluk Jun 20, 2023
62b3a72
Replaced usage of atomic.Int32 since it's only available since 1.19
patsonluk Jun 20, 2023
5cebda2
Fixed race condition - need to enqueue deferredDataTask even if we ar…
patsonluk Jun 21, 2023
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
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ module github.com/fullstorydev/gosolr
go 1.13

require github.com/fullstorydev/zk v1.0.3-0.20200828191825-edfcb5d63fdd

replace github.com/fullstorydev/zk => github.com/patsonluk/zk v1.0.3-0.20230620222602-ecd88884e248
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/fullstorydev/zk v1.0.3-0.20200828191825-edfcb5d63fdd h1:0lubUEXk7T4Z4fJtam94F9IVGK/k/wFw7jjTMpX0Ke8=
github.com/fullstorydev/zk v1.0.3-0.20200828191825-edfcb5d63fdd/go.mod h1:8fIOiu6/LYedHuzFUvyuLg0K2kFGSWGrEnsBytyZ9N4=
github.com/patsonluk/zk v1.0.3-0.20230620222602-ecd88884e248 h1:m4pApDjJN6FgotGGoDIbPIPaMl4JYVmNm6S9cSXXtZ8=
github.com/patsonluk/zk v1.0.3-0.20230620222602-ecd88884e248/go.mod h1:ssbnU3H1lBdE6eTeQ4pyY53X+kHUNqwongLRP8AYygo=
21 changes: 21 additions & 0 deletions solrmonitor/main/solrmonitor/solrmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,24 @@ func (s *sexPantherZkCli) State() zk.State {
func (s *sexPantherZkCli) Close() {
s.delegate.Close()
}

func (s *sexPantherZkCli) Children(path string) ([]string, *zk.Stat, error) {
if s.isFlaky() && s.rnd.Float32() > flakeChance {
return nil, nil, errors.New("flaky error")
}
return s.delegate.Children(path)
}

func (s *sexPantherZkCli) AddPersistentWatch(path string, mode zk.AddWatchMode) (ch zk.EventQueue, err error) {
if s.isFlaky() && s.rnd.Float32() > flakeChance {
return nil, errors.New("flaky error")
}
return s.delegate.AddPersistentWatch(path, mode)
}

func (s *sexPantherZkCli) RemoveAllPersistentWatches(path string) (err error) {
if s.isFlaky() && s.rnd.Float32() > flakeChance {
return errors.New("flaky error")
}
return s.delegate.RemoveAllPersistentWatches(path)
}
13 changes: 13 additions & 0 deletions solrmonitor/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ func newMockZkClient() ZkCli {
type mockZkClient struct {
}

func (m mockZkClient) Children(path string) ([]string, *zk.Stat, error) {
//TODO implement me
panic("implement me")
}

func (m mockZkClient) AddPersistentWatch(path string, mode zk.AddWatchMode) (ch zk.EventQueue, err error) {
panic("implement me")
}

func (m mockZkClient) RemoveAllPersistentWatches(path string) (err error) {
panic("implement me")
}

func (m mockZkClient) ChildrenW(path string) ([]string, *zk.Stat, <-chan zk.Event, error) {
panic("Not implemented")
}
Expand Down
Loading