-
Notifications
You must be signed in to change notification settings - Fork 1
Add fs backend for tests #41
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
base: main
Are you sure you want to change the base?
Conversation
f10cca1 to
cbbee56
Compare
eee3cd9 to
25fc74f
Compare
|
A few comments:
Also, I'm getting the following error when running the tests after rebasing latest main: 👀 |
|
Re-drafting because test don't pass after rebase :) Edit after figuring out why: ❯ tree .../rmq-ct-s3_streams_SUITE-1-21000@localhost/mnesia/rmq-ct-s3_streams_SUITE-1-21000@localhost/rabbitmq_stream_s3_api_fs/
.../rmq-ct-s3_streams_SUITE-1-21000@localhost/mnesia/rmq-ct-s3_streams_SUITE-1-21000@localhost/rabbitmq_stream_s3_api_fs/
└── rabbitmq
└── stream
└── __stream_1_1769682112367012824
<missing metadata/manifest> here
└── data
└── 00000000000000000000.fragment |
4ee175a to
6a613aa
Compare
|
Ah yeah the "uploading the manifest" part probably changed in the rebase because of 7c8fbab. There's some logic to debounce changes so we're not uploading manifests for every little change and there was a bug that made the debounce never happen. You can set the env |
src/rabbitmq_stream_s3_api_fs.erl
Outdated
|
|
||
| -behaviour(rabbitmq_stream_s3_api). | ||
|
|
||
| -define(STORAGE_DIR, filename:join([rabbit:data_dir(), atom_to_list(?MODULE)])). |
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.
For the root directory I was thinking we could pass in a directory we create under the priv_dir from Common Test via application env. So we could have functions like
% rabbitmq_stream_s3_api_fs.erl
-spec data_dir() -> file:filename_all().
data_dir() ->
{ok, Dir} = application:get_env(rabbitmq_stream_s3, api_fs_data_dir),
Dir.
-spec key_to_path(rabbitmq_stream_s3_api:key()) -> file:filename_all().
key_to_path(Key) ->
filename:join(data_dir(), Key).If we share the same directory between all Rabbit nodes in a suite/group it would match the 'write once read many' interaction we have with an object store: a replica node could read data from the shared "remote tier" directory.
So if we had a three node cluster, the CommonTest log_private directory might look like
% tree path/to/log_private/
path/to/log_private/
├── ct_rabbit@mango22-1
│ └── ...
├── ct_SUITE_NAME_remote_data/rabbitmq/stream
│ ├── __sq_1769635311360384578
│ │ ├── data
│ │ │ ├── 00000000000001030220.fragment
│ │ │ ├── 00000000000001035552.fragment
│ │ │ └── ...
│ │ ├── metadata
│ │ │ └── efe4b29116e5a364.manifest
│ │ └── ...
│ └── ...
├── rmq-ct-SUITE_NAME-1-21162@localhost
│ ├── mnesia
│ │ └── rmq-ct-SUITE_NAME-1-21162@localhost
│ │ ├── stream
│ │ │ └── __sq_1769635311360384578
│ │ │ ├── 00000000000005438715.index
│ │ │ ├── 00000000000005438715.segment
│ │ │ ├── 00000000000005697381.index
│ │ │ └── 00000000000005697381.segment
│ │ └── ...
│ └── ...
├── rmq-ct-SUITE_NAME-2-21216@localhost
│ ├── mnesia
│ │ └── rmq-ct-SUITE_NAME-2-21216@localhost
│ │ ├── stream
│ │ │ └── __sq_1769635311360384578
│ │ │ ├── 00000000000005438715.index
│ │ │ ├── 00000000000005438715.segment
│ │ │ ├── 00000000000005697381.index
│ │ │ └── 00000000000005697381.segment
│ │ └── ...
│ └── ...
└── rmq-ct-SUITE_NAME-3-21270@localhost
├── mnesia
│ └── rmq-ct-SUITE_NAME-3-21270@localhost
│ ├── stream
│ │ └── __sq_1769635311360384578
│ │ ├── 00000000000005438715.index
│ │ ├── 00000000000005438715.segment
│ │ ├── 00000000000005697381.index
│ │ └── 00000000000005697381.segment
│ └── ...
└── ...
6a613aa to
459e469
Compare
|
Not undrafting yet as I would like to make the test multinode and probably force some new writer election testcase. Sounds good? |
Issue #36
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.