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

IGNITE-17011 [Native Persistence 3.0] Porting FilePageStoreManager from 2.0 #815

Merged
merged 25 commits into from May 30, 2022

Conversation

tkalkirill
Copy link
Contributor

@tkalkirill
Copy link
Contributor Author

@ibessonov Please make code review.

@tkalkirill
Copy link
Contributor Author

@ibessonov Please make code review.

/**
* Returns file page store path.
*/
Path filePath() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed for current tests, then it will be reworked when there is a new checkpoint algorithm.

/** Logger. */
private final IgniteLogger log;

/** Starting directory for all file page stores, for example: 'db/group-123/index.bin'. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that directory format is agreed upon right now, I'd avoid mentioning it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it as it is for now, we'll change it later and don't forget to take into account that the directories for the engines should be separate.

) throws IgniteInternalCheckedException {
this.log = log;
this.filePageStoreFileIoFactory = filePageStoreFileIoFactory;
this.dbDir = storagePath.resolve("db");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a common folders structure between all engines. Code like resolve("db") shouldn't be here, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it as it is for now, we'll change it later and don't forget to take into account that the directories for the engines should be separate.

FilePageStore[] partitionFilePageStores = new FilePageStore[partitions];

for (int i = 0; i < partitions; i++) {
partitionFilePageStores[i] = filePageStoreFactory.createPageStore(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the original code? I don't see the presence of affinity here, is that intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this step, we create FilePageStore for all partitions, but for partition affinity, we will call FilePageStore#ensure (create a file physically) when creating PartitionStorage.


workers.add(worker);

new IgniteThread(worker).start();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, creating a new thread for every operation - what is this? We should lake a closer look at it afterwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, the thread is created at the node stop, but will need to be reviewed later.

@@ -223,6 +224,10 @@ void testAwaitAsyncTaskCompletion() throws Exception {
() -> finishTask1Future.get(100, TimeUnit.MILLISECONDS)
);

// Checks that the exception will be from task1.
assertThat(exception.getCause(), instanceOf(IgniteInternalException.class));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wonderful.

@ibessonov ibessonov merged commit 8e22afb into apache:main May 30, 2022
@ibessonov ibessonov deleted the ignite-17011 branch May 30, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants