-
-
Notifications
You must be signed in to change notification settings - Fork 79
#2043 add BasicHaTest and first simple resync scenario #2062
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
Open
robfrank
wants to merge
38
commits into
main
Choose a base branch
from
feature/2043-ha-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
07438c9
2043 add first resilience tests using testcontainers and toxyproxy, r…
robfrank be86ad3
refactor: clean up DatabaseWrapper formatting and improve logger init…
robfrank 17cc9f9
refactor: optimize import statements across multiple classes
robfrank 1fa91c7
test: add unit tests for ReplicationLogFile functionality
robfrank ce11a9e
refactor: rename resilience test classes and update package structure
robfrank 4e35d91
fix compilation error
robfrank a5ec801
test: add Java resilience tests to CI pipeline
robfrank 5369a28
test: update resilience tests to run with integration profile
robfrank ecd5935
feat: add initial configuration and setup files for project
robfrank 9521c10
feat: create directories for HA container setup
robfrank 2fab0d2
feat: ensure created directories are writable for HA container setup
robfrank 91fd7c1
feat: update container directory permissions to be non-writable for s…
robfrank 39460e3
feat: modify container setup to set user ID and group ID for security
robfrank cc1bcdd
feat: ensure user ID and group ID are set for container creation
robfrank 2dd918f
feat: set user ID and group ID for container creation using a consumer
robfrank 7b6af7f
feat: update Dockerfile to use alpine image and modify user creation …
robfrank 1edd797
feat: add method to create container directories in test template
robfrank a8b2b5a
refactor: remove commented-out code and clean up whitespace in utilit…
robfrank b2ef671
feat: add checks for user identity and permissions in CI pipeline
robfrank 7d38c48
feat: add additional checks for database directory in CI pipeline
robfrank 8b3658a
feat: update resilience tests command in CI configuration
robfrank 46715f2
feat: add conditional execution for checks in CI configuration
robfrank dd6bfe4
feat: update file system binding to use copy to container method in C…
robfrank 07547f1
feat: add cleanup commands for container databases and logs on stop
robfrank cb1ef30
feat: simplify resilience tests command in CI configuration
robfrank df83ee7
feat: exclude resilience tests from integration tests in CI configura…
robfrank 462d435
wip
robfrank 4347286
feat: remove database comparison after each test and improve cleanup …
robfrank 9f87614
wip
robfrank 2446a3f
wip
robfrank 2c8759c
turn off FINE logging
robfrank b552a99
feat: comment out database comparison and cleanup logic in tests
robfrank 707cc9f
fix missing import
robfrank 16f871d
pre calculate totals
robfrank 592cd69
feat: update photo count in load test and enhance database edge creation
robfrank 2193e4c
feat: enhance load tests by adding friendship count assertion and imp…
robfrank 19a7849
feat: refactor load test logic and improve friendship creation methods
robfrank 9526d1c
rebased on main, use of perf-tests support
robfrank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,20 @@ | |
*/ | ||
|
||
/** | ||
* @author Luca Garulli ([email protected]) | ||
* Utility class for parsing host addresses. | ||
*/ | ||
public class HostUtil { | ||
public static final String CLIENT_DEFAULT_PORT = "2480"; | ||
public static final String HA_DEFAULT_PORT = "2424"; | ||
|
||
/** | ||
* Parses the host address and returns the host and port. If the port is not specified, it returns the default port. | ||
* | ||
* @param host The host address to parse. | ||
* @param defaultPort The default port to use if no port is specified in the host address. | ||
* | ||
* @return An array containing the host and port. | ||
*/ | ||
public static String[] parseHostAddress(String host, final String defaultPort) { | ||
if (host == null) | ||
throw new IllegalArgumentException("Host null"); | ||
|
@@ -33,14 +41,25 @@ public static String[] parseHostAddress(String host, final String defaultPort) { | |
if (host.isEmpty()) | ||
throw new IllegalArgumentException("Host is empty"); | ||
|
||
String alias = ""; | ||
if (host.startsWith("{")) { | ||
alias = host.substring(host.indexOf("{") + 1, host.indexOf("}")); | ||
// REMOVE ALIAS | ||
host = host.substring(host.indexOf("}") + 1); | ||
} | ||
|
||
final String[] parts = host.split(":"); | ||
if (parts.length == 1 || parts.length == 8) | ||
if (parts.length == 1 || parts.length == 8) { | ||
// ( IPV4 OR IPV6 ) NO PORT | ||
return new String[] { host, defaultPort }; | ||
else if (parts.length == 2 || parts.length == 9) { | ||
if (alias.isEmpty()) | ||
alias = host; | ||
return new String[] { host, defaultPort, alias }; | ||
} else if (parts.length == 2 || parts.length == 9) { | ||
// ( IPV4 OR IPV6 ) + PORT | ||
final int pos = host.lastIndexOf(":"); | ||
return new String[] { host.substring(0, pos), host.substring(pos + 1) }; | ||
if (alias.isEmpty()) | ||
alias = host.substring(0, pos); | ||
return new String[] { host.substring(0, pos), host.substring(pos + 1), alias }; | ||
} | ||
|
||
throw new IllegalArgumentException("Invalid host " + host); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you setting false = not require a leader? This means the operation will go to any server, but if it's an update (query is idempotent) will bounce to the leader in 2 passes