[ 
https://issues.apache.org/jira/browse/IGNITE-16150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Pereslegin updated IGNITE-16150:
--------------------------------------
    Description: 
During the snapshot restore procedure after retrieving the partition file from 
the remote node, we create an additional copy of this file.

{code:java}
        for (Map.Entry<UUID, Map<Integer, Set<Integer>>> m : snpAff.entrySet()) 
{
                ctx.cache().context().snapshotMgr()
                        .requestRemoteSnapshotFiles(m.getKey(),
                                opCtx0.snpName,
                                m.getValue(),
                                opCtx0.stopChecker,
                                (snpFile, t) -> {
                                                ...

                                                Path partFile = 
Paths.get(tmpCacheDir.getAbsolutePath(), snpFile.getName());

                                                try {
                                                        
IgniteSnapshotManager.copy(snpMgr.ioFactory(),
                                                            snpFile,
                                                            partFile.toFile(),
                                                            snpFile.length());
                                                ...
{code}

File copying is redundant here and can have significant performance overhead.

Instead, we have to download the file to the target directory (and rename it to 
the desired name if necessary).


  was:
During the snapshot restore procedure after retrieving the partition file from 
the remote node, we create an additional copy of this file.

{code:java}
        for (Map.Entry<UUID, Map<Integer, Set<Integer>>> m : snpAff.entrySet()) 
{
                ctx.cache().context().snapshotMgr()
                        .requestRemoteSnapshotFiles(m.getKey(),
                                opCtx0.snpName,
                                m.getValue(),
                                opCtx0.stopChecker,
                                (snpFile, t) -> {
                                                ...

                                                Path partFile = 
Paths.get(tmpCacheDir.getAbsolutePath(), snpFile.getName());

                                                try {
                                                        
IgniteSnapshotManager.copy(snpMgr.ioFactory(),
                                                ...
{code}

File copying is redundant here and can have significant performance overhead.

Instead, we have to download the file to the target directory (and rename it to 
the desired name if necessary).



> Get rid of redundant copying of files after downloading when restoring a 
> snapshot. 
> -----------------------------------------------------------------------------------
>
>                 Key: IGNITE-16150
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16150
>             Project: Ignite
>          Issue Type: Improvement
>    Affects Versions: 2.12
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: iep-43
>
> During the snapshot restore procedure after retrieving the partition file 
> from the remote node, we create an additional copy of this file.
> {code:java}
>       for (Map.Entry<UUID, Map<Integer, Set<Integer>>> m : snpAff.entrySet()) 
> {
>               ctx.cache().context().snapshotMgr()
>                       .requestRemoteSnapshotFiles(m.getKey(),
>                               opCtx0.snpName,
>                               m.getValue(),
>                               opCtx0.stopChecker,
>                               (snpFile, t) -> {
>                                               ...
>                                               Path partFile = 
> Paths.get(tmpCacheDir.getAbsolutePath(), snpFile.getName());
>                                               try {
>                                                       
> IgniteSnapshotManager.copy(snpMgr.ioFactory(),
>                                                           snpFile,
>                                                           partFile.toFile(),
>                                                           snpFile.length());
>                                               ...
> {code}
> File copying is redundant here and can have significant performance overhead.
> Instead, we have to download the file to the target directory (and rename it 
> to the desired name if necessary).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to