-
Notifications
You must be signed in to change notification settings - Fork 2
Fix find_fragment timestamp predicate and add property-based tests
#77
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
216d25e
Fix `find_fragment` timestamp predicate and add property-based tests
lukebakken c07c5ce
Improve README and add configuration documentation
lukebakken 49e09db
Fix typos and inaccuracies in `docs/README.md`
lukebakken 91f9d8c
Update docs/README.md
lukebakken ea44f99
Look up stream ID from queue type state instead of by resource name
lukebakken 4e537fe
Handle empty index array in `recover_fragments/7`
lukebakken 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # TODO | ||
|
|
||
| ## `stream_test_utils` bug: `receive_stream_commands/3` discards accumulated data on retry | ||
|
|
||
| `stream_test_utils:receive_stream_commands/3` loops up to 10 times calling | ||
| `gen_tcp:recv/3`, accumulating incoming data into the `rabbit_stream_core` | ||
| state. When the loop is exhausted without a complete frame, it returns the | ||
| atom `empty` — but discards the updated core state containing the partially | ||
| accumulated frame data. | ||
|
|
||
| Any caller that retries by calling `receive_stream_commands` again with the | ||
| original core state will re-read from an empty buffer, losing the bytes | ||
| already received. For large chunks (e.g. a 2 MB message), this means the | ||
| frame can never be assembled. | ||
|
|
||
| The fix is to either return the updated core state alongside `empty`, or for | ||
| callers to implement their own recv loop that preserves the accumulated state | ||
| across iterations. `s3_streams_SUITE` works around this with a local | ||
| `receive_deliver/3` helper that calls `rabbit_stream_core:next_command/1` and | ||
| `rabbit_stream_core:incoming_data/2` directly. |
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 |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Configuration | ||
|
|
||
| ## Enabling the plugin | ||
|
|
||
| Add the following to `rabbitmq.conf` to route stream reads and writes through the plugin: | ||
|
|
||
| ``` | ||
| streams.log_reader = rabbitmq_stream_s3_log_reader | ||
| streams.log_manifest = rabbitmq_stream_s3_log_manifest | ||
| ``` | ||
|
|
||
| ## S3 settings | ||
|
|
||
| ### `s3.bucket` | ||
|
|
||
| The S3 bucket to use for remote tier storage. Required. | ||
|
|
||
| ``` | ||
| s3.bucket = my-rabbitmq-streams-bucket | ||
| ``` | ||
|
|
||
| ### `s3.region` | ||
|
|
||
| The AWS region of the S3 bucket. If not set, the plugin attempts to determine the region automatically via the EC2 instance metadata service. | ||
|
|
||
| ``` | ||
| s3.region = us-east-1 | ||
| ``` | ||
|
|
||
| ### `s3.region_endpoints.$region` | ||
|
|
||
| Overrides the endpoint hostname for a given region. Useful for S3-compatible storage or VPC endpoints. | ||
|
|
||
| ``` | ||
| s3.region_endpoints.us-east-1 = s3.us-east-1.amazonaws.com | ||
| ``` | ||
|
|
||
| ## Credentials | ||
|
|
||
| The plugin resolves AWS credentials in the following order: | ||
|
|
||
| 1. Static credentials from `rabbitmq.conf` (`s3.access_key_id` and `s3.secret_key`) | ||
| 2. Container credentials endpoint (if the `AWS_CONTAINER_CREDENTIALS_FULL_URI` environment variable is set) | ||
| 3. EC2 instance metadata service (IMDSv2) | ||
|
|
||
| ### `s3.access_key_id` and `s3.secret_key` | ||
|
|
||
| Static AWS credentials. Not recommended for production; prefer IAM roles. | ||
|
|
||
| ``` | ||
| s3.access_key_id = AKIAIOSFODNN7EXAMPLE | ||
| s3.secret_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY | ||
| ``` |
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.
Uh oh!
There was an error while loading. Please reload this page.