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

OAK-8413 Use the new Azure SDK in the Azure Segment Store #1748

Open
wants to merge 15 commits into
base: trunk
Choose a base branch
from

Conversation

ierandra
Copy link

No description provided.

…to issue/OAK-8413

# Conflicts:
#	oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/SegmentCopy.java
#	oak-segment-azure/src/test/java/org/apache/jackrabbit/oak/segment/azure/AzureSegmentStoreServiceTest.java
@dulceanu
Copy link
Contributor

@ierandra, the build fails with the following error in Oak Segment Azure:
[ERROR] org.apache.jackrabbit.oak.segment.azure: Version increase required; detected 3.0.0, suggested 4.0.0 [ERROR] org.apache.jackrabbit.oak.segment.azure.util: Version increase required; detected 1.71.0, suggested 2.0.0

@ierandra
Copy link
Author

@dulceanu I was using -Dbaseline.skip in the build command.
Please let me know if I should update the versions so that we don't get these messages.

@dulceanu
Copy link
Contributor

@ierandra, yes, the versions need to be updated so that the build passes without skipping the baseline check.

@dulceanu dulceanu requested a review from reschke October 1, 2024 08:59
@dulceanu
Copy link
Contributor

dulceanu commented Oct 1, 2024

Now oak-segment-azure build fails when issuing mvn clean install with lots of test related setup preconditions not met. Could you see what's this about, please?

@ierandra
Copy link
Author

ierandra commented Oct 2, 2024

@dulceanu I fixed all the tests. build should be ok now.

@reschke
Copy link
Contributor

reschke commented Oct 29, 2024

This doesn't seem to compile (after applying the diff to oak trunk):

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project oak-segment-azure: Compilation failure: Compilation failure:
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[43,47] cannot find symbol
[ERROR]   symbol:   class AzureStorageCredentialManager
[ERROR]   location: package org.apache.jackrabbit.oak.segment.azure
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[134,88] cannot find symbol
[ERROR]   symbol:   class AzureStorageCredentialManagerV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[163,76] cannot find symbol
[ERROR]   symbol:   class AzureStorageCredentialManagerV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[169,63] cannot find symbol
[ERROR]   symbol:   class AzureStorageCredentialManagerV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[54,19] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[56,19] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[64,22] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[64,67] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[72,29] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[72,74] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[105,18] cannot find symbol
[ERROR]   symbol:   class BlobItem
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[121,23] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.AzureJournalReader
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[123,23] cannot find symbol
[ERROR]   symbol:   class BlobItem
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.AzureJournalReader
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[131,36] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.AzureJournalReader
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[131,77] cannot find symbol
[ERROR]   symbol:   class BlobItem
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.AzureJournalReader
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[166,17] cannot find symbol
[ERROR]   symbol:   class AppendBlobClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.AzureJournalWriter
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[287,32] cannot find symbol
[ERROR]   symbol:   class BlobContainerClient
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.CombinedReader
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[287,78] cannot find symbol
[ERROR]   symbol:   class BlobItem
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile.CombinedReader
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java:[62,21] cannot find symbol
[ERROR]   symbol:   class CloudBlobDirectory
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureArchiveManager
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java:[69,32] cannot find symbol
[ERROR]   symbol:   class CloudBlobDirectory
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureArchiveManager
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[141,35] cannot find symbol
[ERROR]   symbol:   class AzurePersistenceV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[185,20] cannot find symbol
[ERROR]   symbol:   variable AzureUtilitiesV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[193,14] cannot find symbol
[ERROR]   symbol:   class AzureStorageCredentialManagerV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java:[193,84] cannot find symbol
[ERROR]   symbol:   class AzureStorageCredentialManagerV8
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.tool.ToolUtils
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzurePersistence.java:[68,16] constructor AzureArchiveManager in class org.apache.jackrabbit.oak.segment.azure.AzureArchiveManager cannot be applied to given types;
[ERROR]   required: CloudBlobDirectory,org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitor,org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor,org.apache.jackrabbit.oak.segment.remote.WriteAccessController
[ERROR]   found: com.azure.storage.blob.BlobContainerClient,com.azure.storage.blob.BlobContainerClient,java.lang.String,org.apache.jackrabbit.oak.segment.spi.monitor.IOMonitor,org.apache.jackrabbit.oak.segment.spi.monitor.FileStoreMonitor,org.apache.jackrabbit.oak.segment.remote.WriteAccessController
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[107,13] cannot find symbol
[ERROR]   symbol:   class ListBlobsOptions
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[107,53] cannot find symbol
[ERROR]   symbol:   class ListBlobsOptions
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[109,18] cannot find symbol
[ERROR]   symbol:   class BlobItem
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile
[ERROR] /C:/projects/apache/oak/trunk/oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java:[110,87] cannot find symbol
[ERROR]   symbol:   variable BlobType
[ERROR]   location: class org.apache.jackrabbit.oak.segment.azure.AzureJournalFile

...etc...

Copy link
Contributor

@reschke reschke left a comment

Choose a reason for hiding this comment

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

…to issue/OAK-8413

# Conflicts:
#	oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureArchiveManager.java
#	oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/AzureJournalFile.java
#	oak-segment-azure/src/main/java/org/apache/jackrabbit/oak/segment/azure/tool/ToolUtils.java
@ierandra
Copy link
Author

@reschke I updated the PR with changes from apache/jackrabbit-oak trunk and should be fine now

@ierandra ierandra requested a review from reschke October 29, 2024 15:34
@reschke
Copy link
Contributor

reschke commented Oct 29, 2024

It does indeed; thanks.

@reschke
Copy link
Contributor

reschke commented Oct 29, 2024

This looks a bit weird:

[WARNING] com.azure.core.credential: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] com.azure.core.credential: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] com.azure.identity: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] com.azure.identity: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] com.microsoft.azure.storage: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] com.microsoft.azure.storage: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] com.microsoft.azure.storage.blob: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] com.microsoft.azure.storage.blob: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] com.microsoft.azure.storage.core: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] com.microsoft.azure.storage.core: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.counters: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.counters: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.maps: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.maps: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues.atomic: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues.atomic: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues.atomic.unpadded: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues.atomic.unpadded: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues.unpadded: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.queues.unpadded: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.util: Excessive version increase; detected 1.71.0, suggested 1.70.0
[WARNING] io.netty.util.internal.shaded.org.jctools.util: Version has been increased but analysis detected no changes; detected 1.71.0, suggested 1.70.0

are we exporting these packages?

This looks wrong...:

                        <Export-Package>
                            org.apache.jackrabbit.oak.segment.azure,
                            org.apache.jackrabbit.oak.segment.azure.queue,
                            org.apache.jackrabbit.oak.segment.azure.util,
                            com.fasterxml.jackson.dataformat.xml,
                            com.fasterxml.jackson.dataformat.xml.deser,
                            com.microsoft.azure.storage,
                            com.microsoft.azure.storage.core,
                            com.microsoft.azure.storage.blob,
                            com.azure.core.credential,
                            com.azure.identity,
                            com.azure.blob,
                            com.azure.storage.common,
                            com.azure.storage.internal.avro.implementation
                        </Export-Package>

</Export-Package>
<Embed-Dependency>
azure-storage,
azure-keyvault-core,
azure-core,
azure-identity,
azure-json,
azure-xml,
Copy link
Contributor

Choose a reason for hiding this comment

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

Arer we embedding the new SDK? Why?

(We embedded the old one due to the Guava dependency issue, but this should not be needed here)

Copy link
Author

Choose a reason for hiding this comment

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

I tried without and I got the following error at build:
[ERROR] Bundle oak-segment-azure:1.71-ierandra-T20241104112150-3ccdb109e0 is importing package(s) com.azure.xml in start level 15 but no bundle is exporting these for that start level.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the oak-it-osgi tests? In which case we may have to add the dependency there.

Copy link
Author

Choose a reason for hiding this comment

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

@reschke
Copy link
Contributor

reschke commented Oct 29, 2024

Opened https://issues.apache.org/jira/browse/OAK-11236 - the embedding/exporting issues started earlier.

Copy link
Contributor

@reschke reschke left a comment

Choose a reason for hiding this comment

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

As this adds many new files, please make sure that all of them just use LF as line ends (otherwise fixing this will cause ugly diffs), and check with "-Prat" that all licenses are ok.

@smiroslav
Copy link
Contributor

The build on my machine fails because of baseline plugin

$ mvn clean install -DskipTests
....
[ERROR] org.apache.jackrabbit.oak.segment.azure.util: Version increase required; detected 1.0.0, suggested 2.0.0

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  39.965 s
[INFO] Finished at: 2024-11-12T10:02:29+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:5.1.9:baseline (baseline) on project oak-segment-azure: Baseline failed, see generated report -> [Help 1]
[

@ierandra
Copy link
Author

@smiroslav I configure it back to 2.0.0. should work now

requestOptions.setMaximumExecutionTimeInMs(LEASE_RENEWAL_TIMEOUT_MS);
requestOptions.setRetryPolicyFactory(new RetryNoRetry());
blob.renewLease(AccessCondition.generateLeaseCondition(leaseId), requestOptions, null);
leaseId = leaseClient.renewLeaseWithResponse((RequestConditions) null, Duration.ofMillis(LEASE_RENEWAL_TIMEOUT_MS), Context.NONE).getValue();
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous implementation configured request options with RetryNoRetry.
How is it achieved here?

return new RequestRetryOptions(RetryPolicyType.EXPONENTIAL,
retryAttempts,
timeoutExecution,
timeoutIntervalToMs,
Copy link
Contributor

Choose a reason for hiding this comment

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

the intent of TIMEOUT_INTERVAL_PROP was to specify max execution time for one retry

From the Java documentation

Sets the timeout to use when making this request.
The server timeout interval begins at the time that the complete request has been received by the service, and the server begins processing the response. If the timeout interval elapses before the response is returned to the client, the operation times out. The timeout interval resets with each retry, if the request is retried.

You can check the intent of the properties in the linked below nad map it to the corresponding ones in v12

https://github.com/Azure/azure-storage-java/blob/v8.6.6/microsoft-azure-storage/src/com/microsoft/azure/storage/RequestOptions.java#L266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants